]> git.proxmox.com Git - mirror_zfs.git/commit
Fix file descriptor leak on pool import.
authorPawel Jakub Dawidek <pawel@dawidek.net>
Tue, 23 Jan 2024 23:03:48 +0000 (15:03 -0800)
committerGitHub <noreply@github.com>
Tue, 23 Jan 2024 23:03:48 +0000 (15:03 -0800)
commita4bf6baaeb70a01a4c13fd6139ebdc97bad172e9
tree15d8c614ca973039a1eea6fe99f5e771c79649f8
parent435b173fd9728baf8168611f9fc57fef44f56adc
Fix file descriptor leak on pool import.

Descriptor leak can be easily reproduced by doing:

# zpool import tank
# sysctl kern.openfiles
# zpool export tank; zpool import tank
# sysctl kern.openfiles

We were leaking four file descriptors on every import.

Similar leak most likely existed when using file-based VDEVs.

External-issue: https://reviews.freebsd.org/D43529
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Pawel Jakub Dawidek <pawel@dawidek.net>
Closes #15630
module/os/freebsd/zfs/zfs_file_os.c