]> git.baikalelectronics.ru Git - kernel.git/commit
nfsd: fix dentry refcounting on create
authorJosef Bacik <jbacik@fb.com>
Wed, 10 Aug 2016 18:46:27 +0000 (14:46 -0400)
committerJ. Bruce Fields <bfields@redhat.com>
Thu, 11 Aug 2016 15:42:08 +0000 (11:42 -0400)
commitbe6fb3f4a8b87779980d73df162a41fc18ef8785
treef1998fcb7817d265fc5ac53fb21db03a80e0a6eb
parent1372dac0367f9e37512ea4720cf3886bcb42562d
nfsd: fix dentry refcounting on create

684c52689d introduced a dentry ref counting bug.  Previously we were
grabbing one ref to dchild in nfsd_create(), but with the creation of
nfsd_create_locked() we have a ref for dchild from the lookup in
nfsd_create(), and then another ref in nfsd_create_locked().  The ref
from the lookup in nfsd_create() is never dropped and results in
dentries still in use at unmount.

Signed-off-by: Josef Bacik <jbacik@fb.com>
Fixes: 684c52689d "nfsd: reorganize nfsd_create"
Reported-by: kernel test robot <xiaolong.ye@intel.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Acked-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/vfs.c