mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 10:37:35 +03:00
Skip snapshot in zfs_iter_mounted()
The intention of the zfs_iter_mounted() is to traverse the dataset and its descendants, not the snapshots. The current code can cause a mounted snapshot to be included and thus zfs_open() on the snapshot with ZFS_TYPE_FILESYSTEM would print confusing message such as "cannot open 'rpool/fs@snap': snapshot delimiter '@' is not expected here". Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Youzhong Yang <yyang@mathworks.com> Closes #12447 Closes #12448
This commit is contained in:
@@ -83,7 +83,7 @@ for d in ${test_depths[@]}; do
|
||||
log_must zfs snapshot $TESTPOOL/$ds@snap
|
||||
# force snapshot mount in .zfs
|
||||
log_must ls /$TESTPOOL/$ds/.zfs/snapshot/snap
|
||||
log_must zfs unmount $TESTPOOL/$ds
|
||||
log_must_nostderr zfs unmount $TESTPOOL/$ds
|
||||
|
||||
if ! ismounted $TESTPOOL/$ds_pre; then
|
||||
log_fail "$ds_pre is not mounted"
|
||||
@@ -113,7 +113,7 @@ for d in ${test_depths[@]}; do
|
||||
log_must zfs snapshot $TESTPOOL/$ds@snap
|
||||
# force snapshot mount in .zfs
|
||||
log_must ls /$TESTPOOL/$ds/.zfs/snapshot/snap
|
||||
log_must zfs unmount $TESTPOOL/$ds
|
||||
log_must_nostderr zfs unmount $TESTPOOL/$ds
|
||||
|
||||
if ! ismounted $TESTPOOL/$ds_pre; then
|
||||
log_fail "$TESTPOOL/$ds_pre (pre) not mounted"
|
||||
@@ -143,7 +143,7 @@ for d in ${test_depths[@]}; do
|
||||
log_must zfs snapshot $TESTPOOL/$ds@snap
|
||||
# force snapshot mount in .zfs
|
||||
log_must ls /$TESTPOOL/$ds/.zfs/snapshot/snap
|
||||
log_must zfs unmount $TESTPOOL/$ds
|
||||
log_must_nostderr zfs unmount $TESTPOOL/$ds
|
||||
|
||||
if ! ismounted $TESTPOOL/$ds_pre; then
|
||||
log_fail "$TESTPOOL/$ds_pre (pre) not mounted"
|
||||
@@ -173,7 +173,7 @@ for d in ${test_depths[@]}; do
|
||||
log_must zfs snapshot $TESTPOOL/$ds@snap
|
||||
# force snapshot mount in .zfs
|
||||
log_must ls /$TESTPOOL/$ds/.zfs/snapshot/snap
|
||||
log_must zfs unmount $TESTPOOL/$ds
|
||||
log_must_nostderr zfs unmount $TESTPOOL/$ds
|
||||
|
||||
if ! ismounted $TESTPOOL/$ds_pre; then
|
||||
log_fail "$ds_pre is not mounted"
|
||||
|
||||
Reference in New Issue
Block a user