]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.git/commitdiff
ceph: report STATX_ATTR_ENCRYPTED on encrypted inodes
authorJeff Layton <jlayton@kernel.org>
Tue, 3 May 2022 18:56:51 +0000 (14:56 -0400)
committerJeff Layton <jlayton@kernel.org>
Tue, 31 May 2022 15:50:02 +0000 (11:50 -0400)
Reviewed-by: Xiubo Li <xiubli@redhat.com>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
fs/ceph/inode.c

index 56f2fe005d81824432734efe424f057d7400d78b..519de1748fcb61a0bd6ebf556b7e06e387aaaa42 100644 (file)
@@ -2985,6 +2985,10 @@ int ceph_getattr(struct user_namespace *mnt_userns, const struct path *path,
                        stat->nlink = 1 + 1 + ci->i_subdirs;
        }
 
+       if (IS_ENCRYPTED(inode))
+               stat->attributes |= STATX_ATTR_ENCRYPTED;
+       stat->attributes_mask |= STATX_ATTR_ENCRYPTED;
+
        stat->result_mask = request_mask & valid_mask;
        return err;
 }