Whamcloud - gitweb
LU-14989 sec: access to enc file's xattrs
authorSebastien Buisson <sbuisson@ddn.com>
Tue, 7 Sep 2021 12:24:14 +0000 (14:24 +0200)
committerAndreas Dilger <adilger@whamcloud.com>
Fri, 1 Oct 2021 23:22:57 +0000 (23:22 +0000)
commitbf291f2212a26b0740a3016d11e06b29ef5df9bb
tree4a70d0670a222fe3e5400a63b4355a65ebb0fe25
parent84ff195bd33c4251b927cf4e1285475d37d97949
LU-14989 sec: access to enc file's xattrs

Encryption context is stored in 'security.c' xattr. This is put in the
xattr cache via ll_xattr_cache_insert() to avoid sending a getxattr
request to the server. But this operation declares the xattr cache for
the inode as 'valid', with two consequences. It prevents any further
filling with other xattrs, and trying to read an xattr value will
directly return -ENODATA, without any attempt to fetch the xattr from
the server.
This is solved by adding a new ll_file_flags 'LLIF_XATTR_CACHE_FILLED'
that tells if the xattr cache for the inode has been filled. This bit
is set only by ll_xattr_cache_refill(), and 'valid' now just means the
xattr cache for the inode has been initialized.

Lustre-change: https://review.whamcloud.com/44855
Lustre-commit: 1faf54e8bf19c28a4de7b069309d607cb3f10f91

Fixes: 40d91eafe2 ("LU-12275 sec: atomicity of encryption context getting/setting")
Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Change-Id: I6c2b6870df29f26f048dedeb7212d1c801ca69e1
Reviewed-on: https://review.whamcloud.com/45084
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/llite/llite_internal.h
lustre/llite/statahead.c
lustre/llite/xattr_cache.c
lustre/tests/sanity-sec.sh
lustre/utils/ll_decode_linkea.c