Commit b20a95a0 authored by Yan, Zheng's avatar Yan, Zheng Committed by Sage Weil

ceph: add missing init_acl() for mkdir() and atomic_open()

Signed-off-by: default avatarYan, Zheng <zheng.z.yan@intel.com>
parent 7a92d647
...@@ -695,9 +695,8 @@ static int ceph_mknod(struct inode *dir, struct dentry *dentry, ...@@ -695,9 +695,8 @@ static int ceph_mknod(struct inode *dir, struct dentry *dentry,
ceph_mdsc_put_request(req); ceph_mdsc_put_request(req);
if (!err) if (!err)
err = ceph_init_acl(dentry, dentry->d_inode, dir); ceph_init_acl(dentry, dentry->d_inode, dir);
else
if (err)
d_drop(dentry); d_drop(dentry);
return err; return err;
} }
...@@ -735,7 +734,9 @@ static int ceph_symlink(struct inode *dir, struct dentry *dentry, ...@@ -735,7 +734,9 @@ static int ceph_symlink(struct inode *dir, struct dentry *dentry,
if (!err && !req->r_reply_info.head->is_dentry) if (!err && !req->r_reply_info.head->is_dentry)
err = ceph_handle_notrace_create(dir, dentry); err = ceph_handle_notrace_create(dir, dentry);
ceph_mdsc_put_request(req); ceph_mdsc_put_request(req);
if (err) if (!err)
ceph_init_acl(dentry, dentry->d_inode, dir);
else
d_drop(dentry); d_drop(dentry);
return err; return err;
} }
...@@ -776,7 +777,9 @@ static int ceph_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) ...@@ -776,7 +777,9 @@ static int ceph_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
err = ceph_handle_notrace_create(dir, dentry); err = ceph_handle_notrace_create(dir, dentry);
ceph_mdsc_put_request(req); ceph_mdsc_put_request(req);
out: out:
if (err < 0) if (!err)
ceph_init_acl(dentry, dentry->d_inode, dir);
else
d_drop(dentry); d_drop(dentry);
return err; return err;
} }
......
...@@ -286,6 +286,7 @@ int ceph_atomic_open(struct inode *dir, struct dentry *dentry, ...@@ -286,6 +286,7 @@ int ceph_atomic_open(struct inode *dir, struct dentry *dentry,
} else { } else {
dout("atomic_open finish_open on dn %p\n", dn); dout("atomic_open finish_open on dn %p\n", dn);
if (req->r_op == CEPH_MDS_OP_CREATE && req->r_reply_info.has_create_ino) { if (req->r_op == CEPH_MDS_OP_CREATE && req->r_reply_info.has_create_ino) {
ceph_init_acl(dentry, dentry->d_inode, dir);
*opened |= FILE_CREATED; *opened |= FILE_CREATED;
} }
err = finish_open(file, dentry, ceph_open, opened); err = finish_open(file, dentry, ceph_open, opened);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment