diff mbox series

[24/24] lustre: llite: fix stat attributes_mask

Message ID 1662429337-18737-25-git-send-email-jsimmons@infradead.org (mailing list archive)
State New, archived
Headers show
Series lustre: update to OpenSFS tree Sept 5, 2022 | expand

Commit Message

James Simmons Sept. 6, 2022, 1:55 a.m. UTC
From: Sebastien Buisson <sbuisson@ddn.com>

Fix stat attributes_mask to return STATX_ATTR_ENCRYPTED whenever it is
possible. Also fix sanityn test_106c to expect at least the 0x30 flag
for attributes_mask.

WC-bug-id: https://jira.whamcloud.com/browse/LU-16085
Lustre-commit: 0e48653c27eacad29 ("LU-16085 llite: fix stat attributes_mask")
Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Reviewed-on: https://review.whamcloud.com/48208
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 fs/lustre/llite/file.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/fs/lustre/llite/file.c b/fs/lustre/llite/file.c
index 115ee69..5394cce 100644
--- a/fs/lustre/llite/file.c
+++ b/fs/lustre/llite/file.c
@@ -5268,6 +5268,9 @@  int ll_getattr_dentry(struct dentry *de, struct kstat *stat, u32 request_mask,
 	}
 
 	stat->attributes_mask = STATX_ATTR_IMMUTABLE | STATX_ATTR_APPEND;
+#ifdef CONFIG_FS_ENCRYPTION
+	stat->attributes_mask |= STATX_ATTR_ENCRYPTED;
+#endif
 	stat->attributes |= ll_inode_to_ext_flags(inode->i_flags);
 	stat->result_mask &= request_mask;