Skip to content

Commit

Permalink
ceph: add missing init_acl() for mkdir() and atomic_open()
Browse files Browse the repository at this point in the history
Signed-off-by: Yan, Zheng <[email protected]>
  • Loading branch information
Yan, Zheng authored and Sage Weil committed Feb 17, 2014
1 parent 7a92d64 commit b20a95a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
13 changes: 8 additions & 5 deletions fs/ceph/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -695,9 +695,8 @@ static int ceph_mknod(struct inode *dir, struct dentry *dentry,
ceph_mdsc_put_request(req);

if (!err)
err = ceph_init_acl(dentry, dentry->d_inode, dir);

if (err)
ceph_init_acl(dentry, dentry->d_inode, dir);
else
d_drop(dentry);
return err;
}
Expand Down Expand Up @@ -735,7 +734,9 @@ static int ceph_symlink(struct inode *dir, struct dentry *dentry,
if (!err && !req->r_reply_info.head->is_dentry)
err = ceph_handle_notrace_create(dir, dentry);
ceph_mdsc_put_request(req);
if (err)
if (!err)
ceph_init_acl(dentry, dentry->d_inode, dir);
else
d_drop(dentry);
return err;
}
Expand Down Expand Up @@ -776,7 +777,9 @@ static int ceph_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
err = ceph_handle_notrace_create(dir, dentry);
ceph_mdsc_put_request(req);
out:
if (err < 0)
if (!err)
ceph_init_acl(dentry, dentry->d_inode, dir);
else
d_drop(dentry);
return err;
}
Expand Down
1 change: 1 addition & 0 deletions fs/ceph/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ int ceph_atomic_open(struct inode *dir, struct dentry *dentry,
} else {
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) {
ceph_init_acl(dentry, dentry->d_inode, dir);
*opened |= FILE_CREATED;
}
err = finish_open(file, dentry, ceph_open, opened);
Expand Down

0 comments on commit b20a95a

Please sign in to comment.