X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fllite%2Fxattr_cache.c;h=0a751744e4f207799052d0c0094185b9fcab67fe;hb=1d8faaf6caf4acaf0e2d4943b51c024a96c80624;hp=ce3e3a799b878a1e9ce80cdfc774ecaaa30e7eea;hpb=665383d3a1f4d1dc7f404301039432271ad85eaf;p=fs%2Flustre-release.git diff --git a/lustre/llite/xattr_cache.c b/lustre/llite/xattr_cache.c index ce3e3a7..0a75174 100644 --- a/lustre/llite/xattr_cache.c +++ b/lustre/llite/xattr_cache.c @@ -139,7 +139,8 @@ static int ll_xattr_cache_add(struct list_head *cache, ENTRY; if (ll_xattr_cache_find(cache, xattr_name, &xattr) == 0) { - if (!strcmp(xattr_name, LL_XATTR_NAME_ENCRYPTION_CONTEXT)) + if (!strcmp(xattr_name, LL_XATTR_NAME_ENCRYPTION_CONTEXT) || + !strcmp(xattr_name, LL_XATTR_NAME_ENCRYPTION_CONTEXT_OLD)) /* it means enc ctx was already in cache, * ignore error as it cannot be modified */ @@ -333,8 +334,7 @@ int ll_xattr_cache_empty(struct inode *inode) GOTO(out_empty, 0); list_for_each_entry_safe(entry, n, &lli->lli_xattrs, xe_list) { - if (strcmp(entry->xe_name, - LL_XATTR_NAME_ENCRYPTION_CONTEXT) == 0) + if (strcmp(entry->xe_name, xattr_for_enc(inode)) == 0) continue; CDEBUG(D_CACHE, "delete: %s\n", entry->xe_name); @@ -505,9 +505,13 @@ static int ll_xattr_cache_refill(struct inode *inode) CDEBUG(D_CACHE, "not caching %s\n", XATTR_NAME_ACL_ACCESS); rc = 0; - } else if (!strcmp(xdata, "security.selinux")) { - /* Filter out security.selinux, it is cached in slab */ - CDEBUG(D_CACHE, "not caching security.selinux\n"); + } else if (ll_xattr_is_seclabel(xdata)) { + /* Filter out security label, it is cached in slab */ + CDEBUG(D_CACHE, "not caching %s\n", xdata); + rc = 0; + } else if (!strcmp(xdata, XATTR_NAME_SOM)) { + /* Filter out trusted.som, it is not cached on client */ + CDEBUG(D_CACHE, "not caching trusted.som\n"); rc = 0; } else { rc = ll_xattr_cache_add(&lli->lli_xattrs, xdata, xval, @@ -579,7 +583,7 @@ int ll_xattr_cache_get(struct inode *inode, * cache if we are just interested in encryption context. */ if ((valid & OBD_MD_FLXATTRLS || - strcmp(name, LL_XATTR_NAME_ENCRYPTION_CONTEXT) != 0) && + strcmp(name, xattr_for_enc(inode)) != 0) && !ll_xattr_cache_filled(lli)) { up_read(&lli->lli_xattrs_list_rwsem); rc = ll_xattr_cache_refill(inode);