Skip to content

Commit

Permalink
ceph: avoid creating orphan object when checking pool permission
Browse files Browse the repository at this point in the history
Pool permission check needs to write to the first object. But for
snapshot, head of the first object may have already been deleted.
Skip the check for snapshot inode to avoid creating orphan object.

Link: http://tracker.ceph.com/issues/18211
Signed-off-by: Yan, Zheng <zyan@redhat.com>
  • Loading branch information
Yan, Zheng authored and Ilya Dryomov committed Dec 14, 2016
1 parent dc24de8 commit 80e80fb
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions fs/ceph/addr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1948,6 +1948,15 @@ int ceph_pool_perm_check(struct ceph_inode_info *ci, int need)
struct ceph_string *pool_ns;
int ret, flags;

if (ci->i_vino.snap != CEPH_NOSNAP) {
/*
* Pool permission check needs to write to the first object.
* But for snapshot, head of the first object may have alread
* been deleted. Skip check to avoid creating orphan object.
*/
return 0;
}

if (ceph_test_mount_opt(ceph_inode_to_client(&ci->vfs_inode),
NOPOOLPERM))
return 0;
Expand Down

0 comments on commit 80e80fb

Please sign in to comment.