summaryrefslogtreecommitdiff
path: root/fs/cifs
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-12-01 21:29:55 (GMT)
committerLinus Torvalds <torvalds@linux-foundation.org>2012-12-01 21:29:55 (GMT)
commit331fee3cd31c3ec3641062ca01a71b79dbf58b40 (patch)
tree90fa1a59b0256c82f95853f60b5e551431a1eb43 /fs/cifs
parentb3c3a9cf2a28ee4a8d0b62e2e58c61e9ca9bb47b (diff)
parenta77cfcb429ed98845a4e4df72473b8f37acd890b (diff)
downloadlinux-331fee3cd31c3ec3641062ca01a71b79dbf58b40.tar.xz
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs fixes from Al Viro: "A bunch of fixes; the last one is this cycle regression, the rest are -stable fodder." * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: fix off-by-one in argument passed by iterate_fd() to callbacks lookup_one_len: don't accept . and .. cifs: get rid of blind d_drop() in readdir nfs_lookup_revalidate(): fix a leak don't do blind d_drop() in nfs_prime_dcache()
Diffstat (limited to 'fs/cifs')
-rw-r--r--fs/cifs/readdir.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c
index f9b5d3d..1c576e8 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);