]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
client: avoid creating orphan object in Client::check_pool_perm() 6603/head
authorYan, Zheng <zyan@redhat.com>
Mon, 16 Nov 2015 13:08:00 +0000 (21:08 +0800)
committerYan, Zheng <zyan@redhat.com>
Mon, 16 Nov 2015 13:17:46 +0000 (21:17 +0800)
Fixes: #13782
Signed-off-by: Yan, Zheng <zyan@redhat.com>
src/client/Client.cc

index e9824aa53ccb5b479b69ac581ccd7a863fddc292..aab30522e8905634d66a1ea915c9658ec2b9d60d 100644 (file)
@@ -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];