]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
client: fix leak of file handles
authorXavi Hernandez <xhernandez@gmail.com>
Fri, 16 Feb 2024 18:14:07 +0000 (19:14 +0100)
committerXavi Hernandez <xhernandez@gmail.com>
Mon, 11 Mar 2024 14:18:47 +0000 (15:18 +0100)
commita1d404f16094799aafd759234b2506725a7b499f
tree69ec654d33b8d7204f215ae3bce0ea6ae0121e8b
parent5b2a34ef56db7d882564d7d8cad59eaefef1cce6
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