char *value = NULL;
struct iattr newattrs;
umode_t new_mode = inode->i_mode, old_mode = inode->i_mode;
- struct dentry *dentry = d_find_alias(inode);
+ struct dentry *dentry;
if (acl) {
ret = posix_acl_valid(acl);
goto out_free;
}
+ dentry = d_find_alias(inode);
if (new_mode != old_mode) {
newattrs.ia_mode = new_mode;
newattrs.ia_valid = ATTR_MODE;
ret = ceph_setattr(dentry, &newattrs);
if (ret)
- goto out_free;
+ goto out_dput;
}
if (value)
newattrs.ia_valid = ATTR_MODE;
ceph_setattr(dentry, &newattrs);
}
- goto out_free;
+ goto out_dput;
}
ceph_set_cached_acl(inode, type, acl);
+out_dput:
+ dput(dentry);
out_free:
kfree(value);
out: