* [PATCH] nfs: use IS_ROOT not DCACHE_DISCONNECTED
@ 2013-10-15 21:03 J. Bruce Fields
2013-10-16 7:11 ` Christoph Hellwig
0 siblings, 1 reply; 2+ messages in thread
From: J. Bruce Fields @ 2013-10-15 21:03 UTC (permalink / raw)
To: Trond Myklebust; +Cc: linux-nfs, Al Viro
From: "J. Bruce Fields" <bfields@redhat.com>
This check was added by Al Viro with
d9e80b7de91db05c1c4d2e5ebbfd70b3b3ba0e0f "nfs d_revalidate() is too
trigger-happy with d_drop()", with the explanation that we don't want to
remove the root of a disconnected tree, which will still be included on
the s_anon list.
But DCACHE_DISCONNECTED does *not* actually identify dentries that are
disconnected from the dentry tree or hashed on s_anon. IS_ROOT() is the
way to do that.
Also add a comment from Al's commit to remind us why this check is
there.
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
---
fs/nfs/dir.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index de434f3..2acc77a 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -1139,7 +1139,13 @@ out_zap_parent:
if (inode && S_ISDIR(inode->i_mode)) {
/* Purge readdir caches. */
nfs_zap_caches(inode);
- if (dentry->d_flags & DCACHE_DISCONNECTED)
+ /*
+ * We can't d_drop the root of a disconnected tree:
+ * its d_hash is on the s_anon list and d_drop() would hide
+ * it from shrink_dcache_for_unmount(), leading to busy
+ * inodes on unmount and further oopses.
+ */
+ if (IS_ROOT(dentry))
goto out_valid;
}
/* If we have submounts, don't unhash ! */
--
1.7.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] nfs: use IS_ROOT not DCACHE_DISCONNECTED
2013-10-15 21:03 [PATCH] nfs: use IS_ROOT not DCACHE_DISCONNECTED J. Bruce Fields
@ 2013-10-16 7:11 ` Christoph Hellwig
0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2013-10-16 7:11 UTC (permalink / raw)
To: J. Bruce Fields; +Cc: Trond Myklebust, linux-nfs, Al Viro
On Tue, Oct 15, 2013 at 05:03:16PM -0400, J. Bruce Fields wrote:
> From: "J. Bruce Fields" <bfields@redhat.com>
>
> This check was added by Al Viro with
> d9e80b7de91db05c1c4d2e5ebbfd70b3b3ba0e0f "nfs d_revalidate() is too
> trigger-happy with d_drop()", with the explanation that we don't want to
> remove the root of a disconnected tree, which will still be included on
> the s_anon list.
>
> But DCACHE_DISCONNECTED does *not* actually identify dentries that are
> disconnected from the dentry tree or hashed on s_anon. IS_ROOT() is the
> way to do that.
>
> Also add a comment from Al's commit to remind us why this check is
> there.
Looks good.
Reviewed-by: Christoph Hellwig <hch@lst.de>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-10-16 7:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-15 21:03 [PATCH] nfs: use IS_ROOT not DCACHE_DISCONNECTED J. Bruce Fields
2013-10-16 7:11 ` Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).