From: Patrick Donnelly Date: Tue, 11 Mar 2025 14:51:38 +0000 (-0400) Subject: client: unwrap dentries for getcwd X-Git-Tag: v19.2.3~288^2~5 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=2edaafdf1da61561a237bdb5685a3061cd46074e;p=ceph.git client: unwrap dentries for getcwd This was missed in the path_walk refactor. readdir is not the only way to "get" dentry names. Signed-off-by: Patrick Donnelly (cherry picked from commit cda2a6e6facb24eba96afb51341720336febdd54) --- diff --git a/src/client/Client.cc b/src/client/Client.cc index e2f0ee0fa2357..63fc0dec0030f 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -12257,8 +12257,8 @@ int Client::_getcwd(string& dir, const UserPerm& perms) filepath path; ldout(cct, 10) << __func__ << " " << *cwd << dendl; - Inode *in = cwd.get(); - while (in != root.get()) { + auto in = cwd; + while (in != root) { ceph_assert(in->dentries.size() < 2); // dirs can't be hard-linked // A cwd or ancester is unlinked @@ -12282,11 +12282,14 @@ int Client::_getcwd(string& dir, const UserPerm& perms) // start over path = filepath(); - in = cwd.get(); + in = cwd; continue; } - path.push_front_dentry(dn->name); - in = dn->dir->parent_inode; + auto* diri = dn->dir->parent_inode; + ceph_assert(diri); + auto dname = _unwrap_name(*diri, dn->name, dn->alternate_name); + path.push_front_dentry(dname); + in = InodeRef(diri); } dir = "/"; dir += path.get_path();