Skip to content

Commit cf72518

Browse files
committed
Upstream: Allow snapshots to be mounted.
This avoids the unattractive message when a snapshot is mounted: # zfs unmount BOOM cannot open 'BOOM@send': snapshot delimiter '@' is not expected here Unmount successful for /Volumes/BOOM/fs1 Unmount successful for /Volumes/BOOM/.zfs/snapshot/send Volume BOOM on disk4s1 unmounted
1 parent 0a6c874 commit cf72518

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

lib/libzfs/libzfs_iter.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -580,17 +580,19 @@ zfs_iter_mounted(zfs_handle_t *zhp, zfs_iter_f func, void *data)
580580
continue;
581581

582582
if ((mtab_zhp = zfs_open(zhp->zfs_hdl, entry.mnt_special,
583-
ZFS_TYPE_FILESYSTEM)) == NULL)
583+
ZFS_TYPE_FILESYSTEM|ZFS_TYPE_SNAPSHOT)) == NULL)
584584
continue;
585585

586586
/* Ignore legacy mounts as they are user managed */
587-
verify(zfs_prop_get(mtab_zhp, ZFS_PROP_MOUNTPOINT, mnt_prop,
588-
sizeof (mnt_prop), NULL, NULL, 0, B_FALSE) == 0);
589-
if (strcmp(mnt_prop, "legacy") == 0) {
590-
zfs_close(mtab_zhp);
591-
continue;
587+
if (mtab_zhp->zfs_type != ZFS_TYPE_SNAPSHOT) {
588+
verify(zfs_prop_get(mtab_zhp, ZFS_PROP_MOUNTPOINT,
589+
mnt_prop, sizeof (mnt_prop), NULL, NULL, 0,
590+
B_FALSE) == 0);
591+
if (strcmp(mnt_prop, "legacy") == 0) {
592+
zfs_close(mtab_zhp);
593+
continue;
594+
}
592595
}
593-
594596
err = func(mtab_zhp, data);
595597
}
596598

0 commit comments

Comments
 (0)