]> git.apps.os.sepia.ceph.com Git - ceph-ci.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>
Tue, 11 Oct 2022 08:01:01 +0000 (13:31 +0530)
Fixes: http://tracker.ceph.com/issues/57084
Signed-off-by: Venky Shankar <vshankar@redhat.com>
src/client/Client.cc

index fd3f83ac9172013e2a64cea5b3512ed670ba9326..997f147fec7f8d4f5f0aa9eb0203f155cda1aa98 100644 (file)
@@ -11936,6 +11936,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())