Skip to content

Commit

Permalink
cifs: get rid of blind d_drop() in readdir
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Nov 30, 2012
1 parent c44600c commit 0903a0c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fs/cifs/readdir.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 0903a0c

Please sign in to comment.