Re: [PATCH] NFS: Replace null dentries that appear in readdir'slist

From: Ian Kent
Date: Thu Aug 17 2006 - 20:45:08 EST


On Wed, 2006-08-16 at 17:15 +0100, David Howells wrote:

> fs/nfs/dir.c | 9 +++++++--
> 1 files changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
> index e746ed1..bb8b5f0 100644
> --- a/fs/nfs/dir.c
> +++ b/fs/nfs/dir.c
> @@ -1105,8 +1105,13 @@ static struct dentry *nfs_readdir_lookup
> }
> name.hash = full_name_hash(name.name, name.len);
> dentry = d_lookup(parent, &name);
> - if (dentry != NULL)
> - return dentry;
> + if (dentry != NULL) {
> + /* negative dentries must be reconsidered */
> + if (!IS_ERR(dentry) && !dentry->d_inode)
> + d_drop(dentry);

Don't we need to return something like NULL here also?

> + else
> + return dentry;
> + }
> if (!desc->plus || !(entry->fattr->valid & NFS_ATTR_FATTR))
> return NULL;
> /* Note: caller is already holding the dir->i_mutex! */
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/