diff mbox series

[v15,29/29] ceph: report STATX_ATTR_ENCRYPTED on encrypted inodes

Message ID 20220825133132.153657-30-jlayton@kernel.org (mailing list archive)
State New, archived
Headers show
Series ceph: remaining patches for fscrypt support | expand

Commit Message

Jeff Layton Aug. 25, 2022, 1:31 p.m. UTC
Reviewed-by: Xiubo Li <xiubli@redhat.com>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 fs/ceph/inode.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
index a8a6e55252c0..fb507d57cb26 100644
--- a/fs/ceph/inode.c
+++ b/fs/ceph/inode.c
@@ -3000,6 +3000,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;
 }