From 679b164cd3ba918510107bd0b4a30efb412b241c Mon Sep 17 00:00:00 2001 From: Andrew Walker Date: Mon, 30 Dec 2024 19:06:48 -0600 Subject: [PATCH] Add missing zfs_exit() when snapdir is disabled (#16912) zfs_vget doesn't zfs_exit when erroring out due to snapdir being disabled. Signed-off-by: Andrew Walker Reviewed-by: @bmeagherix Reviewed-by: Alexander Motin Reviewed-by: Ameer Hamza Reviewed-by: Tony Hutter --- module/os/linux/zfs/zfs_vfsops.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/module/os/linux/zfs/zfs_vfsops.c b/module/os/linux/zfs/zfs_vfsops.c index 3c53a8a31..b226fca14 100644 --- a/module/os/linux/zfs/zfs_vfsops.c +++ b/module/os/linux/zfs/zfs_vfsops.c @@ -1702,13 +1702,14 @@ zfs_vget(struct super_block *sb, struct inode **ipp, fid_t *fidp) /* A zero fid_gen means we are in the .zfs control directories */ if (fid_gen == 0 && (object == ZFSCTL_INO_ROOT || object == ZFSCTL_INO_SNAPDIR)) { - *ipp = zfsvfs->z_ctldir; - ASSERT(*ipp != NULL); - if (zfsvfs->z_show_ctldir == ZFS_SNAPDIR_DISABLED) { + zfs_exit(zfsvfs, FTAG); return (SET_ERROR(ENOENT)); } + *ipp = zfsvfs->z_ctldir; + ASSERT(*ipp != NULL); + if (object == ZFSCTL_INO_SNAPDIR) { VERIFY(zfsctl_root_lookup(*ipp, "snapshot", ipp, 0, kcred, NULL, NULL) == 0);