aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph/acl.c
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2014-01-31 10:25:25 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-01-31 11:14:06 -0500
commit77516dc92a14bb3853df959c0cb3ef51e659f5af (patch)
tree57f75022e461782f61b28280c6f12c602b19d398 /fs/ceph/acl.c
parente7651b819e90da924991d727d3c007200a18670d (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.c9
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
179out_dput:
180 dput(dentry);
178out_free: 181out_free:
179 kfree(value); 182 kfree(value);
180out: 183out: