Skip to content

Commit 679b164

Browse files
anodos325behlendorf
authored andcommitted
Add missing zfs_exit() when snapdir is disabled (openzfs#16912)
zfs_vget doesn't zfs_exit when erroring out due to snapdir being disabled. Signed-off-by: Andrew Walker <[email protected]> Reviewed-by: @bmeagherix Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Ameer Hamza <[email protected]> Reviewed-by: Tony Hutter <[email protected]>
1 parent c2d9494 commit 679b164

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

module/os/linux/zfs/zfs_vfsops.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1702,13 +1702,14 @@ zfs_vget(struct super_block *sb, struct inode **ipp, fid_t *fidp)
17021702
/* A zero fid_gen means we are in the .zfs control directories */
17031703
if (fid_gen == 0 &&
17041704
(object == ZFSCTL_INO_ROOT || object == ZFSCTL_INO_SNAPDIR)) {
1705-
*ipp = zfsvfs->z_ctldir;
1706-
ASSERT(*ipp != NULL);
1707-
17081705
if (zfsvfs->z_show_ctldir == ZFS_SNAPDIR_DISABLED) {
1706+
zfs_exit(zfsvfs, FTAG);
17091707
return (SET_ERROR(ENOENT));
17101708
}
17111709

1710+
*ipp = zfsvfs->z_ctldir;
1711+
ASSERT(*ipp != NULL);
1712+
17121713
if (object == ZFSCTL_INO_SNAPDIR) {
17131714
VERIFY(zfsctl_root_lookup(*ipp, "snapshot", ipp,
17141715
0, kcred, NULL, NULL) == 0);

0 commit comments

Comments
 (0)