]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
client: fix leak of file handles 55619/head
authorXavi Hernandez <xhernandez@gmail.com>
Fri, 16 Feb 2024 18:14:07 +0000 (19:14 +0100)
committerXavi Hernandez <xhernandez@gmail.com>
Mon, 19 Feb 2024 08:38:53 +0000 (09:38 +0100)
commitfe5c13d2e207473d48aa818484584d67dc3d23b5
treee785a6e149674657af8821eceed1cd91a4d3c0bd
parentf83cac68b718dcfdeac8c07da9409a16ef58eeef
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>
src/client/Client.cc
src/client/Client.h