]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client: use parent directory POSIX ACLs for snaphot dir
authorVenky Shankar <vshankar@redhat.com>
Wed, 14 Sep 2022 04:01:13 +0000 (00:01 -0400)
committerVenky Shankar <vshankar@redhat.com>
Thu, 20 Oct 2022 04:42:55 +0000 (10:12 +0530)
Fixes: http://tracker.ceph.com/issues/57084
Signed-off-by: Venky Shankar <vshankar@redhat.com>
(cherry picked from commit 09ad04d52e2e9ca70561be78b03a29dc00b21f30)

src/client/Client.cc

index 56be2a1108afca8fbe2cb720b21e46d9fca478f4..3a67eca0553beae2dedd3c2f9cd4f90dfcd40c51 100644 (file)
@@ -11840,6 +11840,12 @@ Inode *Client::open_snapdir(Inode *diri)
 
     in->dirfragtree.clear();
     in->snapdir_parent = diri;
+    // copy posix acls to snapshotted inode
+    for (auto &[xattr_key, xattr_value] : diri->xattrs) {
+      if (xattr_key.rfind("system.", 0) == 0) {
+        in->xattrs[xattr_key] = xattr_value;
+      }
+    }
     diri->flags |= I_SNAPDIR_OPEN;
     inode_map[vino] = in;
     if (use_faked_inos())