From patchwork Tue Sep 6 01:55:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Simmons X-Patchwork-Id: 12966744 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from pdx1-mailman-customer002.dreamhost.com (listserver-buz.dreamhost.com [69.163.136.29]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 167DBECAAD3 for ; Tue, 6 Sep 2022 01:56:39 +0000 (UTC) Received: from pdx1-mailman-customer002.dreamhost.com (localhost [127.0.0.1]) by pdx1-mailman-customer002.dreamhost.com (Postfix) with ESMTP id 4MM7m65qsQz1yCC; Mon, 5 Sep 2022 18:56:38 -0700 (PDT) Received: from smtp4.ccs.ornl.gov (smtp4.ccs.ornl.gov [160.91.203.40]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pdx1-mailman-customer002.dreamhost.com (Postfix) with ESMTPS id 4MM7lL6s2Nz1yBW for ; Mon, 5 Sep 2022 18:55:58 -0700 (PDT) Received: from star.ccs.ornl.gov (star.ccs.ornl.gov [160.91.202.134]) by smtp4.ccs.ornl.gov (Postfix) with ESMTP id F3658100B054; Mon, 5 Sep 2022 21:55:39 -0400 (EDT) Received: by star.ccs.ornl.gov (Postfix, from userid 2004) id F169358994; Mon, 5 Sep 2022 21:55:39 -0400 (EDT) From: James Simmons To: Andreas Dilger , Oleg Drokin , NeilBrown Date: Mon, 5 Sep 2022 21:55:37 -0400 Message-Id: <1662429337-18737-25-git-send-email-jsimmons@infradead.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1662429337-18737-1-git-send-email-jsimmons@infradead.org> References: <1662429337-18737-1-git-send-email-jsimmons@infradead.org> Subject: [lustre-devel] [PATCH 24/24] lustre: llite: fix stat attributes_mask X-BeenThere: lustre-devel@lists.lustre.org X-Mailman-Version: 2.1.39 Precedence: list List-Id: "For discussing Lustre software development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lustre Development List MIME-Version: 1.0 Errors-To: lustre-devel-bounces@lists.lustre.org Sender: "lustre-devel" From: Sebastien Buisson 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 Reviewed-on: https://review.whamcloud.com/48208 Reviewed-by: Andreas Dilger Reviewed-by: James Simmons Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- fs/lustre/llite/file.c | 3 +++ 1 file changed, 3 insertions(+) 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;