]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
client: Gracefully handle empty pathname for statxat()
authorAnoop C S <anoopcs@cryptolab.net>
Mon, 23 Sep 2024 07:06:55 +0000 (12:36 +0530)
committerAnoop C S <anoopcs@cryptolab.net>
Tue, 23 Sep 2025 13:50:59 +0000 (19:20 +0530)
commit8cfe15a59cce2e7c295d7c8108a39f75ab843a44
treeecd67be3f8fd7d37cb4af5d4537d77ebda76b019
parent47166cf7ba57260d4a86d4801acaf984e33bd68b
client: Gracefully handle empty pathname for statxat()

man statx(2)[1] says the following:
. . .
AT_EMPTY_PATH
    If pathname is an empty string, operate on the file referred to by
    dirfd (which may have been obtained using the open(2) O_PATH flag).
    In this case, dirfd can refer to any type of file, not just a
    directory.

    If dirfd is AT_FDCWD, the call operates on the current working
    directory.
. . .

Look out for an empty pathname and use the relative fd's inode in the
presence of AT_EMPTY_PATH flag before calling internal _getattr().

Fixes: https://tracker.ceph.com/issues/68189
Review with: git show -w

[1] https://www.man7.org/linux/man-pages/man2/statx.2.html

Signed-off-by: Anoop C S <anoopcs@cryptolab.net>
(cherry picked from commit edd7fe76c4919bc243377c6d7aae20b0606b89c3)

Conflicts:
        src/client/Client.cc
- path_walk() refactor from https://github.com/ceph/ceph/pull/62095
  included the required core changes.
src/include/cephfs/ceph_ll_client.h
src/include/cephfs/libcephfs.h
src/libcephfs.cc
src/test/libcephfs/test.cc