* [PATCH] nfs: don't drop dentry in d_revalidate
@ 2005-10-07 11:21 Miklos Szeredi
2005-10-07 13:52 ` Trond Myklebust
2005-10-07 14:38 ` Al Viro
0 siblings, 2 replies; 4+ messages in thread
From: Miklos Szeredi @ 2005-10-07 11:21 UTC (permalink / raw)
To: akpm; +Cc: viro, trond.myklebust, linux-kernel
NFS d_revalidate() is doing things that are supposed to be done by
d_invalidate().
Dropping the dentry is especially bad, since it will make
d_invalidate() bypass all checks.
Signed-off-by: Miklos Szeredi <miklos@szeredi.hu>
---
Index: linux/fs/nfs/dir.c
===================================================================
--- linux.orig/fs/nfs/dir.c 2005-10-04 13:59:57.000000000 +0200
+++ linux/fs/nfs/dir.c 2005-10-07 12:53:45.000000000 +0200
@@ -762,12 +762,7 @@ out_zap_parent:
if (inode && S_ISDIR(inode->i_mode)) {
/* Purge readdir caches. */
nfs_zap_caches(inode);
- /* If we have submounts, don't unhash ! */
- if (have_submounts(dentry))
- goto out_valid;
- shrink_dcache_parent(dentry);
}
- d_drop(dentry);
unlock_kernel();
dput(parent);
return 0;
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] nfs: don't drop dentry in d_revalidate
2005-10-07 11:21 [PATCH] nfs: don't drop dentry in d_revalidate Miklos Szeredi
@ 2005-10-07 13:52 ` Trond Myklebust
2005-10-07 14:04 ` Miklos Szeredi
2005-10-07 14:38 ` Al Viro
1 sibling, 1 reply; 4+ messages in thread
From: Trond Myklebust @ 2005-10-07 13:52 UTC (permalink / raw)
To: Miklos Szeredi; +Cc: akpm, viro, linux-kernel
fr den 07.10.2005 Klokka 13:21 (+0200) skreiv Miklos Szeredi:
> NFS d_revalidate() is doing things that are supposed to be done by
> d_invalidate().
>
> Dropping the dentry is especially bad, since it will make
> d_invalidate() bypass all checks.
NAK!
Bypassing the stupid d_invalidate checks is precisely the point here.
Unlike local filesystems, we have to deal with the case where someone
deletes a file on the server and then creates a new one with the same
name. The d_invalidate checks will keep the wrong dentry hashed for as
long as some borken process has the file open.
Trond
> Signed-off-by: Miklos Szeredi <miklos@szeredi.hu>
> ---
>
> Index: linux/fs/nfs/dir.c
> ===================================================================
> --- linux.orig/fs/nfs/dir.c 2005-10-04 13:59:57.000000000 +0200
> +++ linux/fs/nfs/dir.c 2005-10-07 12:53:45.000000000 +0200
> @@ -762,12 +762,7 @@ out_zap_parent:
> if (inode && S_ISDIR(inode->i_mode)) {
> /* Purge readdir caches. */
> nfs_zap_caches(inode);
> - /* If we have submounts, don't unhash ! */
> - if (have_submounts(dentry))
> - goto out_valid;
> - shrink_dcache_parent(dentry);
> }
> - d_drop(dentry);
> unlock_kernel();
> dput(parent);
> return 0;
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] nfs: don't drop dentry in d_revalidate
2005-10-07 13:52 ` Trond Myklebust
@ 2005-10-07 14:04 ` Miklos Szeredi
0 siblings, 0 replies; 4+ messages in thread
From: Miklos Szeredi @ 2005-10-07 14:04 UTC (permalink / raw)
To: trond.myklebust; +Cc: akpm, viro, linux-kernel
> > NFS d_revalidate() is doing things that are supposed to be done by
> > d_invalidate().
> >
> > Dropping the dentry is especially bad, since it will make
> > d_invalidate() bypass all checks.
>
> NAK!
>
> Bypassing the stupid d_invalidate checks is precisely the point here.
>
> Unlike local filesystems, we have to deal with the case where someone
> deletes a file on the server and then creates a new one with the same
> name. The d_invalidate checks will keep the wrong dentry hashed for as
> long as some borken process has the file open.
>
d_invalidate() only makes sense for network filesystems like NFS. If
it's broken, fix it. But bypassing it is definitely the wrong thing
to do.
Miklos
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] nfs: don't drop dentry in d_revalidate
2005-10-07 11:21 [PATCH] nfs: don't drop dentry in d_revalidate Miklos Szeredi
2005-10-07 13:52 ` Trond Myklebust
@ 2005-10-07 14:38 ` Al Viro
1 sibling, 0 replies; 4+ messages in thread
From: Al Viro @ 2005-10-07 14:38 UTC (permalink / raw)
To: Miklos Szeredi; +Cc: akpm, trond.myklebust, linux-kernel
On Fri, Oct 07, 2005 at 01:21:01PM +0200, Miklos Szeredi wrote:
> NFS d_revalidate() is doing things that are supposed to be done by
> d_invalidate().
>
> Dropping the dentry is especially bad, since it will make
> d_invalidate() bypass all checks.
NAK. _IF_ you are going to start playing with that area, start with
handling that stuff in caller before going after methods.
Note that the only relatively sane semantics is to have equivalent on
umount -l done to everything that becomes unreachable.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2005-10-07 14:38 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-07 11:21 [PATCH] nfs: don't drop dentry in d_revalidate Miklos Szeredi
2005-10-07 13:52 ` Trond Myklebust
2005-10-07 14:04 ` Miklos Szeredi
2005-10-07 14:38 ` Al Viro
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox