Project

General

Profile

Feature #39098 ยป 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

View differences:

src/mds/Server.cc
lov.add_xlock(&dn->lock);
lov.add_wrlock(&diri->filelock);
lov.add_wrlock(&diri->nestlock);
lov.add_xlock(&in->linklock);
/*
* If the client issuing the unlink holds Lx caps, then we don't need the
* linklock. Just assume that it will update the link count accordingly.
*/
Capability *cap = in->get_client_cap(client);
if (!(cap->issued() & CEPH_CAP_LINK_EXCL))
lov.add_xlock(&in->linklock);
if (straydn) {
lov.add_wrlock(&straydn->get_dir()->inode->filelock);
lov.add_wrlock(&straydn->get_dir()->inode->nestlock);
    (1-1/1)