[LU-3670] some trusted xattrs are not coherent on the client Created: 30/Jul/13  Updated: 26/Sep/13  Resolved: 26/Sep/13

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.5.0
Fix Version/s: Lustre 2.5.0

Type: Bug Priority: Critical
Reporter: John Hammond Assignee: John Hammond
Resolution: Fixed Votes: 0
Labels: llite, mdt, patch, xattr

Issue Links:
Related
is related to LU-2869 extended attribute cache for Lustre Resolved
Severity: 3
Rank (Obsolete): 9458

 Description   

The value of trusted.link should change as hard links are added to files.

# llmount.sh
# cd /mnt/lustre
# touch f0
# getfattr -n trusted.link f0
# file: f0
trusted.link=0s3/HqEQEAAAAsAAAAAAAAAAAAAAAAAAAAABQAAAACAAAABwAAAAEAAAAAZjA=

# getfattr -n trusted.link f0 | md5sum
f0ea62a3d3c5efd8329b1147bf97ce7b  -
# ln f0 f1
# getfattr -n trusted.link f0 | md5sum
f0ea62a3d3c5efd8329b1147bf97ce7b  -
# sys_lea f0
[0x200000007:0x1:0x0] 'f0'

Before extended attribute caching landed the trusted.link attribute is updated and the interpreting the link EA has the expected result:

# cd /mnt/lustre
# touch f0
# getfattr -n trusted.link f0
# file: f0
trusted.link=0s3/HqEQEAAAAsAAAAAAAAAAAAAAAAAAAAABQAAAACAAAABwAAAAEAAAAAZjA=

# getfattr -n trusted.link f0 | md5sum
f0ea62a3d3c5efd8329b1147bf97ce7b  -
# ln f0 f1
# getfattr -n trusted.link f0 | md5sum
53753efeb8ce17a87df257ee317c7b68  -
# sys_lea f0
[0x200000007:0x1:0x0] 'f0'
[0x200000007:0x1:0x0] 'f1'

The lov xattrs appear to be immune to this issue since they are handled by special cases in ll_

{get,set}

xattr() but I did not verify this in all cases. Some other attributes (trusted.hsm) which are modified outside of the normal MDS_SETXATTR path are also affected.



 Comments   
Comment by Andrew Perepechko [ 31/Jul/13 ]

It looks like the following extended attributes can be modified in the mdd or osd layer:

XATTR_NAME_LMA "trusted.lma"
XATTR_NAME_LINK "trusted.link"
XATTR_NAME_ACL_DEFAULT "system.posix_acl_default"
XATTR_NAME_ACL_ACCESS "system.posix_acl_access"
XATTR_NAME_LOV "trusted.lov"
XATTR_NAME_HSM "trusted.hsm"

"trusted.link" updates require XATTR inode bit cancellation in mdt_reint_unlink, mdt_reint_link and mdt_reint_rename.
I pushed http://review.whamcloud.com/#/c/7186/ with fixes for XATTR_NAME_LINK, and will update the patch with HSM soon.

Comment by John Hammond [ 31/Jul/13 ]

Andrew, I was thinking it might be best for the trusted xattrs to bypass the cache. What do you think?

Comment by Andrew Perepechko [ 31/Jul/13 ]

John, I like this solution, since the original goal was to speed up samba clients. Trusted attr lookups seem unlikely.

Comment by Andreas Dilger [ 31/Jul/13 ]

John, except that tools like SELinux depend heavily on trusted.* xattrs and will benefit significantly from the cache. I don't think many of them change very frequently, with the exception of .link being the possible exception (and not even that will change very often).

Comment by Andrew Perepechko [ 31/Jul/13 ]

SELinux uses "security.selinux" to store object contexts. Hopefully, it is not affected by that.

Comment by Andrew Perepechko [ 31/Jul/13 ]

One of the shortcomings of trusted.* filtering is that listxattr data cannot be cached as well.

Comment by Andrew Perepechko [ 31/Jul/13 ]

I updated the patch with xattr locking for HSM:
mdt_swap_layouts, mdt_reint_setattr (via mdt_add_dirty_flag), mdt_mfd_close (vid mdt_hsm_release), mdt_hsm_state_set.

Comment by Peter Jones [ 26/Sep/13 ]

Landed for 2.5

Generated at Sat Feb 10 01:35:54 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.