Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Sage Weil and committed by
Linus Torvalds
77516dc9 e7651b81

+6 -3
+6 -3
fs/ceph/acl.c
··· 107 107 char *value = NULL; 108 108 struct iattr newattrs; 109 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 112 if (acl) { 113 113 ret = posix_acl_valid(acl); ··· 151 151 goto out_free; 152 152 } 153 153 154 + dentry = d_find_alias(inode); 154 155 if (new_mode != old_mode) { 155 156 newattrs.ia_mode = new_mode; 156 157 newattrs.ia_valid = ATTR_MODE; 157 158 ret = ceph_setattr(dentry, &newattrs); 158 159 if (ret) 159 - goto out_free; 160 + goto out_dput; 160 161 } 161 162 162 163 if (value) ··· 171 170 newattrs.ia_valid = ATTR_MODE; 172 171 ceph_setattr(dentry, &newattrs); 173 172 } 174 - goto out_free; 173 + goto out_dput; 175 174 } 176 175 177 176 ceph_set_cached_acl(inode, type, acl); 178 177 178 + out_dput: 179 + dput(dentry); 179 180 out_free: 180 181 kfree(value); 181 182 out: