Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-5453

mdt_attr_set() uses EX lock for slave 0, PW for master and other slaves

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • Lustre 2.7.0
    • Lustre 2.7.0
    • 3
    • 15176

    Description

      In the striped directory case of mdt_attr_set() we use a EX lock on slave 0 while we use a PW lock on the master inode and the other slaves:

      mdt_attr_set()
      	__u64 lockpart = MDS_INODELOCK_UPDATE;
      
      	if (ma->ma_attr.la_valid & (LA_MODE|LA_UID|LA_GID))
      		lockpart |= MDS_INODELOCK_LOOKUP | MDS_INODELOCK_PERM;
      
              lh = &info->mti_lh[MDT_LH_PARENT];
      	mdt_lock_reg_init(lh, LCK_PW);
      
              rc = mdt_object_lock(info, mo, lh, lockpart, MDT_LOCAL_LOCK);
              if (rc != 0)
              	RETURN(rc);
      
              s0_lh = &info->mti_lh[MDT_LH_LOCAL];
              mdt_lock_reg_init(s0_lh, LCK_EX);
              rc = mdt_lock_slaves(info, mo, LCK_PW, lockpart, s0_lh, &s0_obj, einfo);
              if (rc != 0)
              	GOTO(out_unlock, rc);
      

      Because the locking order is master, slave0, then other slaves this seems prone to causing deadlocks.

      Attachments

        Activity

          People

            jhammond John Hammond
            jhammond John Hammond
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: