From: Sebastien Buisson Date: Fri, 31 Jul 2020 17:51:01 +0000 (+0200) Subject: LU-12275 sec: ldiskfs not aware of client-side encryption X-Git-Tag: 2.13.56~63 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=ad444ed9836320c6ae8b770ff96edd6b0fe4f0d4;p=fs%2Flustre-release.git LU-12275 sec: ldiskfs not aware of client-side encryption In osd-ldiskfs, always remove S_ENCRYPTED from inode flags, because ldiskfs must not be aware of client-side encryption status. This info is just stored into LMA so that it can be forwared to client side. Signed-off-by: Sebastien Buisson Change-Id: Ief08c059b04b8c7349d725b50b2094183eabc4d3 Reviewed-on: https://review.whamcloud.com/39558 Reviewed-by: Andreas Dilger Tested-by: jenkins Tested-by: Maloo Reviewed-by: Wang Shilong Reviewed-by: Oleg Drokin --- diff --git a/lustre/osd-ldiskfs/osd_handler.c b/lustre/osd-ldiskfs/osd_handler.c index 3948b6d..d869811 100644 --- a/lustre/osd-ldiskfs/osd_handler.c +++ b/lustre/osd-ldiskfs/osd_handler.c @@ -2917,6 +2917,13 @@ static int osd_inode_setattr(const struct lu_env *env, /* always keep S_NOCMTIME */ inode->i_flags = ll_ext_to_inode_flags(attr->la_flags) | S_NOCMTIME; +#if defined(S_ENCRYPTED) + /* Always remove S_ENCRYPTED, because ldiskfs must not be + * aware of encryption status. It is just stored into LMA + * so that it can be forwared to client side. + */ + inode->i_flags &= ~S_ENCRYPTED; +#endif /* * Ext4 did not transfer inherit flags from * @inode->i_flags to raw inode i_flags when writing