Can I omit acquire_locks in getattr handler of mds?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I found ls command costs extremely long time (form 30s to 3mins).
So I tried to remove acquire_locks in mds's getattr handler: handle_clinet_getattr.
Everything looks just good:
First, the size of files get updated in time.
Second, the read and write to file from clinets works ok.

So, please, can I just omiit acquire_locks in mds getattr handler?(if client request doesn't requier or have Fwb caps)

Code:

diff -- git a/src/mds/Server.cc n/src/mds/Server.cc

--- a/src/mds/Server.cc
+++ b/src/mds/Server.cc
@@ -3021,7 +3021,10 @@ void Server::handler_client_getattr(MDRequestRef& mdr, bool is_lookup)
    if ((mask & CEPH_CAP_FILE_SHARED) && (issued & CEPH_CAP_FILE_EXCL) == 0) rdlocks.insert(&ref->filelock);
    if ((mask & CEPH_CAP_XATTR_SHARED) && (issued & CEPH_CAP_XATTR_EXCL) == 0) rdlocks.insert(&ref->xattrlock);
-   if (!mds->locker->acquire_locks(mdr, rdlocks, wrlocks, xlocks))
+   dout(20) << __func__ << " mask " << ccap_string(mask) << " issued " << 
ccap_string(issued) << " " << !is_lookup << " ." << dendl;
+   if(!(mask & CEPH_CAP_FILE_WR) && !(mask & CEPH_CAP_FILE_BUFFER) && !(issued & CEPH_CAP_FILE_WR) && !(iissued & CEPH_CAP_FILE_BUFFER) && !is_lookup)      
+     dout(10) << "no Fw/b in mask " << ccap_string(mask) << " or issued " << ccap_string(issued) << " " << !is_lookup << " ." << dendl;+   else if (!mds->locker->acquire_locks(mdr, rdlocks, wrlocks, xlocks))
      return;


    if (!check_access(mdr, ref, MAY_READ))
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux