diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-11-30 04:11:06 +0100 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-11-30 04:11:06 +0100 |
commit | 0903a0c8491c1e987dfc6eb294199a36760398bc (patch) | |
tree | c84f18c8cb39af36fc0492ceb930038879be9da1 /fs | |
parent | nfs_lookup_revalidate(): fix a leak (diff) | |
download | linux-0903a0c8491c1e987dfc6eb294199a36760398bc.tar.xz linux-0903a0c8491c1e987dfc6eb294199a36760398bc.zip |
cifs: get rid of blind d_drop() in readdir
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/cifs/readdir.c | 5 |
1 files changed, 4 insertions, 1 deletions
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); |