]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
client: fix leak of file handles 56121/head
authorXavi Hernandez <xhernandez@gmail.com>
Fri, 16 Feb 2024 18:14:07 +0000 (19:14 +0100)
committerXavi Hernandez <xhernandez@gmail.com>
Wed, 20 Mar 2024 09:01:41 +0000 (10:01 +0100)
commit2c3c75e57a8b3beea32bd6b394fe5f616f691886
tree97091b8001debb2c084156998aa2b2a8d2eaff26
parenta92c34eb7bbbaef0de89ab62b535612c1574b6ad
client: fix leak of file handles

Based on posix specification, the fd passed to fdopendir() will be
closed by closedir(). However CephFS client wasn't doing that. If the
user opened a directory using ceph_openat(), for example, and then
passed the returned fd to ceph_fdopendir(), the created Fh associated
with the new open was never destroyed.

This patch records the fd used in ceph_fdopendir() so that it can be
closed when ceph_closedir() is called.

Fixes: https://tracker.ceph.com/issues/64479
Signed-off-by: Xavi Hernandez <xhernandez@gmail.com>
(cherry picked from commit fe5c13d2e207473d48aa818484584d67dc3d23b5)
src/client/Client.cc
src/client/Client.h