From: Miklos Szeredi Date: Thu, 5 Sep 2013 09:44:36 +0000 (+0200) Subject: vfs: check submounts and drop atomically X-Git-Tag: v3.12-rc1~105^2~9 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=848ac114e847af3f1f9141c90a39ebe79bdb13b3;p=pandora-kernel.git vfs: check submounts and drop atomically We check submounts before doing d_drop() on a non-empty directory dentry in NFS (have_submounts()), but we do not exclude a racing mount. Process A: have_submounts() -> returns false Process B: mount() -> success Process A: d_drop() This patch prepares the ground for the fix by doing the following operations all under the same rename lock: have_submounts() shrink_dcache_parent() d_drop() This is actually an optimization since have_submounts() and shrink_dcache_parent() both traverse the same dentry tree separately. Signed-off-by: Miklos Szeredi CC: David Howells CC: Steven Whitehouse CC: Trond Myklebust CC: Greg Kroah-Hartman Signed-off-by: Al Viro --- Reading git-diff-tree failed