diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-11-29 22:11:06 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-11-29 22:11:06 -0500 |
commit | 0903a0c8491c1e987dfc6eb294199a36760398bc (patch) | |
tree | c84f18c8cb39af36fc0492ceb930038879be9da1 | |
parent | c44600c9d1de64314c2bd58103f15acb53e10073 (diff) |
cifs: get rid of blind d_drop() in readdir
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-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); |