lkml.org 
[lkml]   [2006]   [Aug]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH] NFS: Replace null dentries that appear in readdir's list
    From
    Date
    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);

    And there's no dput for this gotten dentry.

    > - if (dentry != NULL)
    > - return dentry;
    > + if (dentry != NULL) {
    > + /* negative dentries must be reconsidered */
    > + if (!IS_ERR(dentry) && !dentry->d_inode)
    > + d_drop(dentry);
    > + else
    > + return dentry;
    > + }
    > if (!desc->plus || !(entry->fattr->valid & NFS_ATTR_FATTR))
    > return NULL;
    > /* Note: caller is already holding the dir->i_mutex! */

    Sorry I didn't look at this more closely earlier.

    Just looking at this function alone it looks to me like it is
    essentially part of a dentry instantiation which would mean a negative
    dentry is perfectly valid at the point above.

    Ian

    -
    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/

    \
     
     \ /
      Last update: 2006-08-18 03:03    [W:0.023 / U:0.240 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site