Project

General

Profile

0001-MDS-only-take-linklock-in-unlink-if-client-doesn-t-h.patch

PATCH: only acquire linklock if client doesn't hold Lx - Jeff Layton, 04/05/2019 03:29 PM

Download (1.46 KB)

View differences:

src/mds/Server.cc
6636 6636
  lov.add_xlock(&dn->lock);
6637 6637
  lov.add_wrlock(&diri->filelock);
6638 6638
  lov.add_wrlock(&diri->nestlock);
6639
  lov.add_xlock(&in->linklock);
6639

  
6640
  /*
6641
   * If the client issuing the unlink holds Lx caps, then we don't need the
6642
   * linklock. Just assume that it will update the link count accordingly.
6643
   */
6644
  Capability *cap = in->get_client_cap(client);
6645
  if (!(cap->issued() & CEPH_CAP_LINK_EXCL))
6646
    lov.add_xlock(&in->linklock);
6647

  
6640 6648
  if (straydn) {
6641 6649
    lov.add_wrlock(&straydn->get_dir()->inode->filelock);
6642 6650
    lov.add_wrlock(&straydn->get_dir()->inode->nestlock);
6643
-