From 511435f568115637dfd1901584d206e44072b1be Mon Sep 17 00:00:00 2001 From: "Yan, Zheng" Date: Mon, 16 Nov 2015 21:08:00 +0800 Subject: [PATCH] client: avoid creating orphan object in Client::check_pool_perm() Fixes: #13782 Signed-off-by: Yan, Zheng --- src/client/Client.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/client/Client.cc b/src/client/Client.cc index e9824aa53ccb5..aab30522e8905 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]; -- 2.39.5