fs/locks: use properly initialized file_lock when unlocking.
authorNeilBrown <neilb@suse.com>
Thu, 29 Nov 2018 23:04:08 +0000 (10:04 +1100)
committerJeff Layton <jlayton@kernel.org>
Fri, 30 Nov 2018 16:26:12 +0000 (11:26 -0500)
commitd6367d6241371566597c9ab6efe4de0abf254eed
tree9c7443570a1cd0bb05d2ddfbcb16b2383851cc35
parent4316c3c685f5bd949e75eb99df09a18e45cc8e5c
fs/locks: use properly initialized file_lock when unlocking.

Both locks_remove_posix() and locks_remove_flock() use a
struct file_lock without calling locks_init_lock() on it.
This means the various list_heads are not initialized, which
will become a problem with a later patch.

So change them both to initialize properly.  For flock locks,
this involves using flock_make_lock(), and changing it to
allow a file_lock to be passed in, so memory allocation isn't
always needed.

Signed-off-by: NeilBrown <neilb@suse.com>
Reviewed-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
fs/locks.c