From: Yan, Zheng Date: Mon, 16 Nov 2015 13:08:00 +0000 (+0800) Subject: client: avoid creating orphan object in Client::check_pool_perm() X-Git-Tag: v10.0.1~33^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F6603%2Fhead;p=ceph.git client: avoid creating orphan object in Client::check_pool_perm() Fixes: #13782 Signed-off-by: Yan, Zheng --- diff --git a/src/client/Client.cc b/src/client/Client.cc index e9824aa53cc..aab30522e89 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -11344,6 +11344,13 @@ int Client::check_pool_perm(Inode *in, int need) } if (!have) { + if (in->snapid != 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. To avoid creating + // orphan object, skip the check for now. + return 0; + } + pool_perms[pool] = POOL_CHECKING; char oid_buf[32];