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)