]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
client: process path without inode anchor 62406/head
authorPatrick Donnelly <pdonnell@ibm.com>
Thu, 20 Mar 2025 01:25:35 +0000 (21:25 -0400)
committerPatrick Donnelly <pdonnell@ibm.com>
Thu, 20 Mar 2025 01:33:09 +0000 (21:33 -0400)
ll_walk was wrongly coded to make the input file path relative to ino=0. That inode
does not exist and isn't considered the root inode.

Fixes: https://tracker.ceph.com/issues/70573
Fixes: e08210dda01f4e154561fcf008084e6d640e4683
Signed-off-by: Patrick Donnelly <pdonnell@ibm.com>
src/client/Client.cc

index 4d864873eb11087f58f69b4d45a9c0b3fc969c34..309456403b39faf1dec8808f00692128dc5af40a 100644 (file)
@@ -13315,9 +13315,7 @@ int Client::ll_walk(const char* name, Inode **out, struct ceph_statx *stx,
   if (!mref_reader.is_state_satisfied())
     return -ENOTCONN;
 
-  filepath fp(name, 0);
   InodeRef in;
-  int rc;
   unsigned mask = statx_to_mask(flags, want);
 
   ldout(cct, 3) << __func__ << " " << name << dendl;
@@ -13325,8 +13323,7 @@ int Client::ll_walk(const char* name, Inode **out, struct ceph_statx *stx,
   tout(cct) << name << std::endl;
 
   std::scoped_lock lock(client_lock);
-  rc = path_walk(cwd, fp, &in, perms, {.followsym = !(flags & AT_SYMLINK_NOFOLLOW), .mask = mask});
-  if (rc < 0) {
+  if (int rc = path_walk(cwd, filepath(name), &in, perms, {.followsym = !(flags & AT_SYMLINK_NOFOLLOW), .mask = mask}); rc < 0) {
     /* zero out mask, just in case... */
     stx->stx_mask = 0;
     stx->stx_ino = 0;