mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
Fix zfs_destroy_001_pos.ksh
Due to how the Linux VFS was designed busy mount points cannot be destroyed even when given the force option. Update the zfs_destroy_001_pos test case to expect this behavior when running under Linux. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: candychencan <chen.can2@zte.com.cn> Closes #5132
This commit is contained in:
committed by
Brian Behlendorf
parent
66e93f5e4e
commit
84347be098
@@ -126,7 +126,7 @@ function test_n_check
|
||||
"(pidlist: $pidlist)"
|
||||
[[ -z $pidlist ]] && \
|
||||
log_fail "Failure from $MKBUSY"
|
||||
log_must $ZFS destroy -rR $dtst
|
||||
log_must_busy $ZFS destroy -rR $dtst
|
||||
log_must $ZFS snapshot $dtst
|
||||
fi
|
||||
;;
|
||||
@@ -137,13 +137,24 @@ function test_n_check
|
||||
log_note "$MKBUSY $mpt_dir (pidlist: $pidlist)"
|
||||
[[ -z $pidlist ]] && \
|
||||
log_fail "Failure from $MKBUSY"
|
||||
log_must $ZFS destroy -rR $dtst
|
||||
log_must $ZFS snapshot $dtst
|
||||
if is_linux ; then
|
||||
log_mustnot $ZFS destroy -rR $dtst
|
||||
else
|
||||
log_must $ZFS destroy -rR $dtst
|
||||
log_must $ZFS snapshot $dtst
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
*) log_fail "Unsupported dataset: '$dtst'."
|
||||
esac
|
||||
|
||||
# Kill any lingering instances of mkbusy, and clear the list.
|
||||
if is_linux ; then
|
||||
[[ -z $pidlist ]] || log_must $KILL -TERM $pidlist
|
||||
pidlist=""
|
||||
log_mustnot $PGREP -fl $MKBUSY
|
||||
fi
|
||||
|
||||
# Firstly, umount ufs filesystem which was created by zfs volume.
|
||||
if is_global_zone; then
|
||||
log_must $UMOUNT -f $TESTDIR1
|
||||
@@ -153,9 +164,11 @@ function test_n_check
|
||||
log_must $ZFS destroy $opt $dtst
|
||||
|
||||
# Kill any lingering instances of mkbusy, and clear the list.
|
||||
[[ -z $pidlist ]] || log_must $KILL -TERM $pidlist
|
||||
pidlist=""
|
||||
log_mustnot $PGREP -fl $MKBUSY
|
||||
if ! is_linux ; then
|
||||
[[ -z $pidlist ]] || log_must $KILL -TERM $pidlist
|
||||
pidlist=""
|
||||
log_mustnot $PGREP -fl $MKBUSY
|
||||
fi
|
||||
|
||||
case $dtst in
|
||||
$CTR) check_dataset datasetnonexists \
|
||||
|
||||
Reference in New Issue
Block a user