Whamcloud - gitweb
LU-14989 sec: access to enc file's xattrs 55/44855/4
authorSebastien Buisson <sbuisson@ddn.com>
Tue, 7 Sep 2021 12:24:14 +0000 (14:24 +0200)
committerOleg Drokin <green@whamcloud.com>
Fri, 1 Oct 2021 15:09:58 +0000 (15:09 +0000)
commit1faf54e8bf19c28a4de7b069309d607cb3f10f91
tree29de91641d95b80813ce861945df40c081493670
parentcc42eecd8430d3b1f3ec12fc7c28352e3d7d655c
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.

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/44855
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
Reviewed-by: Oleg Drokin <green@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