Skip to content

Commit

Permalink
Check if mnt_cache is enabled before trying to use it.
Browse files Browse the repository at this point in the history
Signed-off-by: Jorgen Lundman <lundman@lundman.net>
  • Loading branch information
lundman committed Dec 3, 2024
1 parent 773833e commit 568161d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/libzfs/libzfs_mount.c
Original file line number Diff line number Diff line change
Expand Up @@ -532,11 +532,13 @@ zfs_mount_at(zfs_handle_t *zhp, const char *options, int flags,
}

/* remove the mounted entry before re-adding on remount */
if (remount)
libzfs_mnttab_remove(hdl, zhp->zfs_name);
if (hdl->libzfs_mnttab_enable) {
if (remount)
libzfs_mnttab_remove(hdl, zhp->zfs_name);

/* add the mounted entry into our cache */
libzfs_mnttab_add(hdl, zfs_get_name(zhp), mountpoint, mntopts);
/* add the mounted entry into our cache */
libzfs_mnttab_add(hdl, zfs_get_name(zhp), mountpoint, mntopts);
}
return (0);
}

Expand Down

0 comments on commit 568161d

Please sign in to comment.