diff options
author | Sage Weil <sage@inktank.com> | 2014-01-31 10:25:25 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-01-31 11:14:06 -0500 |
commit | 77516dc92a14bb3853df959c0cb3ef51e659f5af (patch) | |
tree | 57f75022e461782f61b28280c6f12c602b19d398 /fs/ceph/acl.c | |
parent | e7651b819e90da924991d727d3c007200a18670d (diff) |
ceph: fix missing dput in ceph_set_acl
Add matching dput() for d_find_alias(). Move d_find_alias() down a bit
at Julia's suggestion.
[ Introduced by commit 72466d0b92e0: "ceph: fix posix ACL hooks" ]
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Reported-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Ilya Dryomov <ilya.dryomov@inktank.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/ceph/acl.c')
-rw-r--r-- | fs/ceph/acl.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/ceph/acl.c b/fs/ceph/acl.c index 9ab312e49637..4c2d452c4bfc 100644 --- a/fs/ceph/acl.c +++ b/fs/ceph/acl.c | |||
@@ -107,7 +107,7 @@ int ceph_set_acl(struct inode *inode, struct posix_acl *acl, int type) | |||
107 | char *value = NULL; | 107 | char *value = NULL; |
108 | struct iattr newattrs; | 108 | struct iattr newattrs; |
109 | umode_t new_mode = inode->i_mode, old_mode = inode->i_mode; | 109 | umode_t new_mode = inode->i_mode, old_mode = inode->i_mode; |
110 | struct dentry *dentry = d_find_alias(inode); | 110 | struct dentry *dentry; |
111 | 111 | ||
112 | if (acl) { | 112 | if (acl) { |
113 | ret = posix_acl_valid(acl); | 113 | ret = posix_acl_valid(acl); |
@@ -151,12 +151,13 @@ int ceph_set_acl(struct inode *inode, struct posix_acl *acl, int type) | |||
151 | goto out_free; | 151 | goto out_free; |
152 | } | 152 | } |
153 | 153 | ||
154 | dentry = d_find_alias(inode); | ||
154 | if (new_mode != old_mode) { | 155 | if (new_mode != old_mode) { |
155 | newattrs.ia_mode = new_mode; | 156 | newattrs.ia_mode = new_mode; |
156 | newattrs.ia_valid = ATTR_MODE; | 157 | newattrs.ia_valid = ATTR_MODE; |
157 | ret = ceph_setattr(dentry, &newattrs); | 158 | ret = ceph_setattr(dentry, &newattrs); |
158 | if (ret) | 159 | if (ret) |
159 | goto out_free; | 160 | goto out_dput; |
160 | } | 161 | } |
161 | 162 | ||
162 | if (value) | 163 | if (value) |
@@ -170,11 +171,13 @@ int ceph_set_acl(struct inode *inode, struct posix_acl *acl, int type) | |||
170 | newattrs.ia_valid = ATTR_MODE; | 171 | newattrs.ia_valid = ATTR_MODE; |
171 | ceph_setattr(dentry, &newattrs); | 172 | ceph_setattr(dentry, &newattrs); |
172 | } | 173 | } |
173 | goto out_free; | 174 | goto out_dput; |
174 | } | 175 | } |
175 | 176 | ||
176 | ceph_set_cached_acl(inode, type, acl); | 177 | ceph_set_cached_acl(inode, type, acl); |
177 | 178 | ||
179 | out_dput: | ||
180 | dput(dentry); | ||
178 | out_free: | 181 | out_free: |
179 | kfree(value); | 182 | kfree(value); |
180 | out: | 183 | out: |