]> git.baikalelectronics.ru Git - kernel.git/commit
locks: fix error in locks_move_blocks()
authorNeilBrown <neilb@suse.com>
Thu, 3 Jan 2019 00:04:08 +0000 (11:04 +1100)
committerJeff Layton <jlayton@kernel.org>
Thu, 3 Jan 2019 01:14:50 +0000 (20:14 -0500)
commitfdd8bd03179f3ec6c650b9f36204ba8d3372b3f0
tree1455f36d7c23d38d42b0fa8709660c0e91bfd57c
parentd99f791fb9cbb1c6362313e12af92a9c6fdcc253
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: syzbot+239d99847eb49ecb3899@syzkaller.appspotmail.com
Fixes: 7fb6bb143600 ("fs/locks: allow a lock request to block other requests.")
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
fs/locks.c