diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-12-01 16:29:55 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-12-01 16:29:55 -0500 |
commit | 331fee3cd31c3ec3641062ca01a71b79dbf58b40 (patch) | |
tree | 90fa1a59b0256c82f95853f60b5e551431a1eb43 /fs/cifs | |
parent | b3c3a9cf2a28ee4a8d0b62e2e58c61e9ca9bb47b (diff) | |
parent | a77cfcb429ed98845a4e4df72473b8f37acd890b (diff) |
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.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, | |||
86 | 86 | ||
87 | dentry = d_lookup(parent, name); | 87 | dentry = d_lookup(parent, name); |
88 | if (dentry) { | 88 | if (dentry) { |
89 | int err; | ||
89 | inode = dentry->d_inode; | 90 | inode = dentry->d_inode; |
90 | /* update inode in place if i_ino didn't change */ | 91 | /* update inode in place if i_ino didn't change */ |
91 | if (inode && CIFS_I(inode)->uniqueid == fattr->cf_uniqueid) { | 92 | if (inode && CIFS_I(inode)->uniqueid == fattr->cf_uniqueid) { |
92 | cifs_fattr_to_inode(inode, fattr); | 93 | cifs_fattr_to_inode(inode, fattr); |
93 | return dentry; | 94 | return dentry; |
94 | } | 95 | } |
95 | d_drop(dentry); | 96 | err = d_invalidate(dentry); |
96 | dput(dentry); | 97 | dput(dentry); |
98 | if (err) | ||
99 | return NULL; | ||
97 | } | 100 | } |
98 | 101 | ||
99 | dentry = d_alloc(parent, name); | 102 | dentry = d_alloc(parent, name); |