]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: switch to mdr->get_client()
authorXiubo Li <xiubli@redhat.com>
Tue, 18 May 2021 05:43:29 +0000 (13:43 +0800)
committerPatrick Donnelly <pdonnell@redhat.com>
Mon, 28 Jun 2021 19:38:50 +0000 (12:38 -0700)
The get_client() will check the mdr's type, if not a client request
it will return -1.

Signed-off-by: Xiubo Li <xiubli@redhat.com>
(cherry picked from commit 4357fa8028f320e973644b7b74aedab567afde2e)

src/mds/MDCache.cc

index 37a36179fd62300c33ff7aa1bb09721dd4f21988..f0a376d1ee3286fbf028ab09c44dbf72eb5c4560 100644 (file)
@@ -8149,7 +8149,7 @@ int MDCache::path_traverse(MDRequestRef& mdr, MDSContextFactory& cf,
   if (mdr)
     mdr->snapid = snapid;
 
-  client_t client = (mdr && mdr->reqid.name.is_client()) ? mdr->reqid.name.num() : -1;
+  client_t client = mdr ? mdr->get_client() : -1;
 
   if (mds->logger) mds->logger->inc(l_mds_traverse);