Skip to content

Commit

Permalink
Add missing zfs_exit() when snapdir is disabled (openzfs#16912)
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
anodos325 authored and behlendorf committed Jan 3, 2025
1 parent c2d9494 commit 679b164
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions module/os/linux/zfs/zfs_vfsops.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 679b164

Please sign in to comment.