diff mbox series

[v16,66/68] ceph: report STATX_ATTR_ENCRYPTED on encrypted inodes

Message ID 20230227032813.337906-67-xiubli@redhat.com
State New
Headers show
Series ceph+fscrypt: full support | expand

Commit Message

Xiubo Li Feb. 27, 2023, 3:28 a.m. UTC
From: Jeff Layton <jlayton@kernel.org>

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 696c4c826b0b..495415fada04 100644
--- a/fs/ceph/inode.c
+++ b/fs/ceph/inode.c
@@ -3008,6 +3008,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;
 }