]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
client: Gracefully handle empty pathname for statxat() 59936/head
authorAnoop C S <anoopcs@cryptolab.net>
Mon, 23 Sep 2024 07:06:55 +0000 (12:36 +0530)
committerAnoop C S <anoopcs@cryptolab.net>
Thu, 7 Nov 2024 05:09:16 +0000 (10:39 +0530)
commitedd7fe76c4919bc243377c6d7aae20b0606b89c3
tree1089089afdd266db082456e6a35e14546b0c8114
parent92c5ab99b8dcaae56e4a92cfe72a7e3d343b8a0c
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>
src/client/Client.cc
src/include/cephfs/ceph_ll_client.h
src/include/cephfs/libcephfs.h
src/libcephfs.cc
src/test/libcephfs/test.cc