From: Al Viro Date: Fri, 30 Nov 2012 03:11:06 +0000 (-0500) Subject: cifs: get rid of blind d_drop() in readdir X-Git-Tag: firefly_0821_release~3680^2~1564^2~2 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=0903a0c8491c1e987dfc6eb294199a36760398bc;p=firefly-linux-kernel-4.4.55.git cifs: get rid of blind d_drop() in readdir Signed-off-by: Al Viro --- diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c index f9b5d3d6cf33..1c576e871366 100644 --- a/fs/cifs/readdir.c +++ b/fs/cifs/readdir.c @@ -86,14 +86,17 @@ cifs_readdir_lookup(struct dentry *parent, struct qstr *name, dentry = d_lookup(parent, name); if (dentry) { + int err; inode = dentry->d_inode; /* update inode in place if i_ino didn't change */ if (inode && CIFS_I(inode)->uniqueid == fattr->cf_uniqueid) { cifs_fattr_to_inode(inode, fattr); return dentry; } - d_drop(dentry); + err = d_invalidate(dentry); dput(dentry); + if (err) + return NULL; } dentry = d_alloc(parent, name);