Commit 0903a0c8 authored by Al Viro's avatar Al Viro

cifs: get rid of blind d_drop() in readdir

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent c44600c9
...@@ -86,14 +86,17 @@ cifs_readdir_lookup(struct dentry *parent, struct qstr *name, ...@@ -86,14 +86,17 @@ cifs_readdir_lookup(struct dentry *parent, struct qstr *name,
dentry = d_lookup(parent, name); dentry = d_lookup(parent, name);
if (dentry) { if (dentry) {
int err;
inode = dentry->d_inode; inode = dentry->d_inode;
/* update inode in place if i_ino didn't change */ /* update inode in place if i_ino didn't change */
if (inode && CIFS_I(inode)->uniqueid == fattr->cf_uniqueid) { if (inode && CIFS_I(inode)->uniqueid == fattr->cf_uniqueid) {
cifs_fattr_to_inode(inode, fattr); cifs_fattr_to_inode(inode, fattr);
return dentry; return dentry;
} }
d_drop(dentry); err = d_invalidate(dentry);
dput(dentry); dput(dentry);
if (err)
return NULL;
} }
dentry = d_alloc(parent, name); dentry = d_alloc(parent, name);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment