[LU-5563] MDC does not cancel enough locks for setxattr Created: 29/Aug/14  Updated: 01/May/23

Status: Open
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.7.0
Fix Version/s: None

Type: Improvement Priority: Minor
Reporter: John Hammond Assignee: WC Triage
Resolution: Unresolved Votes: 0
Labels: ldlm, lug23dd, mdc, xattr

Severity: 3
Rank (Obsolete): 15515

 Description   

In mdc_xattr_common() we cancel any MDS_INODELOCK_XATTR locks before setxattr. In mdt_reint_setxattr() we cancel (MDS_INODELOCK_UPDATE | MDS_INODELOCK_PERM | MDS_INODELOCK_LOOKUP) or (MDS_INODELOCK_UPDATE | MDS_INODELOCK_XATTR).

        lockpart = MDS_INODELOCK_UPDATE;
        /* Revoke all clients' lookup lock, since the access
         * permissions for this inode is changed when ACL_ACCESS is
         * set. This isn't needed for ACL_DEFAULT, since that does
         * not change the access permissions of this inode, nor any
         * other existing inodes. It is setting the ACLs inherited
         * by new directories/files at create time. */
        /* We need revoke both LOOKUP|PERM lock here, see mdt_attr_set. */
        if (!strcmp(xattr_name, XATTR_NAME_ACL_ACCESS))
        	lockpart |= MDS_INODELOCK_PERM | MDS_INODELOCK_LOOKUP;
        /* We need to take the lock on behalf of old clients so that newer
         * clients flush their xattr caches */
        else
            	lockpart |= MDS_INODELOCK_XATTR;

	lh = &info->mti_lh[MDT_LH_PARENT];
	/* ACLs were sent to clients under LCK_CR locks, so taking LCK_EX
         * to cancel them. */
	mdt_lock_reg_init(lh, LCK_EX);
	obj = mdt_object_find_lock(info, rr->rr_fid1, lh, lockpart);

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