OSDN Git Service

nfs: Don't take a reference on fl->fl_file for LOCK operation
authorBenjamin Coddington <bcodding@redhat.com>
Thu, 5 Jan 2017 15:20:16 +0000 (10:20 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 9 Dec 2017 17:42:42 +0000 (18:42 +0100)
commitf2fb416f4af6f957caa7efc9ed51c37cb1e40a2b
treeb2a458c3426e023d49d5d4dffc4fdf0375c92cd5
parent7228df818d90cd9a79481f003055130597ca4a68
nfs: Don't take a reference on fl->fl_file for LOCK operation

[ Upstream commit 4b09ec4b14a168bf2c687e1f598140c3c11e9222 ]

I have reports of a crash that look like __fput() was called twice for
a NFSv4.0 file.  It seems possible that the state manager could try to
reclaim a lock and take a reference on the fl->fl_file at the same time the
file is being released if, during the close(), a signal interrupts the wait
for outstanding IO while removing locks which then skips the removal
of that lock.

Since 83bfff23e9ed ("nfs4: have do_vfs_lock take an inode pointer") has
removed the need to traverse fl->fl_file->f_inode in nfs4_lock_done(),
taking that reference is no longer necessary.

Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfs/nfs4proc.c