Skip to content

Commit bf77ae4

Browse files
NeilBrownjtlayton
authored andcommitted
locks: fix error in locks_move_blocks()
After moving all requests from fl->fl_blocked_requests to new->fl_blocked_requests it is nonsensical to do anything to all the remaining elements, there aren't any. This should do something to all the requests that have been moved. For simplicity, it does it to all requests in the target list. Setting "f->fl_blocker = new" to all members of new->fl_blocked_requests is "obviously correct" as it preserves the invariant of the linkage among requests. Reported-by: [email protected] Fixes: 5946c43 ("fs/locks: allow a lock request to block other requests.") Signed-off-by: NeilBrown <[email protected]> Signed-off-by: Jeff Layton <[email protected]>
1 parent 8e143b9 commit bf77ae4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/locks.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ static void locks_move_blocks(struct file_lock *new, struct file_lock *fl)
453453
return;
454454
spin_lock(&blocked_lock_lock);
455455
list_splice_init(&fl->fl_blocked_requests, &new->fl_blocked_requests);
456-
list_for_each_entry(f, &fl->fl_blocked_requests, fl_blocked_member)
456+
list_for_each_entry(f, &new->fl_blocked_requests, fl_blocked_member)
457457
f->fl_blocker = new;
458458
spin_unlock(&blocked_lock_lock);
459459
}

0 commit comments

Comments
 (0)