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
*/
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);
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,
* 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);