diff options
author | youzhongyang <[email protected]> | 2021-10-20 19:07:19 -0400 |
---|---|---|
committer | GitHub <[email protected]> | 2021-10-20 16:07:19 -0700 |
commit | ec64fdb93d144ab1884097cfd36e18b62a2db848 (patch) | |
tree | b0f072cb457e720ab25a074989440e55845f72a3 /tests/zfs-tests | |
parent | 1886cdfcfb970d57d4a2ae40b56d2dab2f029e2b (diff) |
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 <[email protected]>
Signed-off-by: Youzhong Yang <[email protected]>
Closes #12447
Closes #12448
Diffstat (limited to 'tests/zfs-tests')
-rwxr-xr-x | tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_nested.ksh | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_nested.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_nested.ksh index 987ecca31..7da8be3d1 100755 --- a/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_nested.ksh +++ b/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_nested.ksh @@ -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" |