]> git.proxmox.com Git - zfsonlinux.git/blob - zfs-patches/0033-Cleanup-zloop-working-directory-after-each-pass.patch
buildsys: upload to pmg as well
[zfsonlinux.git] / zfs-patches / 0033-Cleanup-zloop-working-directory-after-each-pass.patch
1 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2 From: Don Brady <dev.fs.zfs@gmail.com>
3 Date: Thu, 21 Sep 2017 11:17:56 -0600
4 Subject: [PATCH] Cleanup zloop working directory after each pass
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 Reviewed-by: George Melikov <mail@gmelikov.ru>
10 Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
11 Reviewed by: John Kennedy <jwk404@gmail.com>
12 Reviewed-by: Olaf Faaland <faaland1@llnl.gov>
13 Signed-off-by: Don Brady <don.brady@delphix.com>
14 Issue #6595
15 Closes #6663
16 (cherry picked from commit d1630dda5857175bad0ac7f6e142ae299606d88a)
17 Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
18 ---
19 scripts/zloop.sh | 11 +++++++++--
20 1 file changed, 9 insertions(+), 2 deletions(-)
21
22 diff --git a/scripts/zloop.sh b/scripts/zloop.sh
23 index 03e825059..f0af87553 100755
24 --- a/scripts/zloop.sh
25 +++ b/scripts/zloop.sh
26 @@ -101,6 +101,7 @@ function store_core
27 {
28 core="$(core_file)"
29 if [[ $ztrc -ne 0 ]] || [[ -f "$core" ]]; then
30 + df -h "$workdir" >>ztest.out
31 coreid=$(date "+zloop-%y%m%d-%H%M%S")
32 foundcrashes=$((foundcrashes + 1))
33
34 @@ -150,7 +151,8 @@ function store_core
35 # parse arguments
36 # expected format: zloop [-t timeout] [-c coredir] [-- extra ztest args]
37 coredir=$DEFAULTCOREDIR
38 -workdir=$DEFAULTWORKDIR
39 +basedir=$DEFAULTWORKDIR
40 +rundir="zloop-run"
41 timeout=0
42 size="512m"
43 while getopts ":ht:s:c:f:" opt; do
44 @@ -158,7 +160,7 @@ while getopts ":ht:s:c:f:" opt; do
45 t ) [[ $OPTARG -gt 0 ]] && timeout=$OPTARG ;;
46 s ) [[ $OPTARG ]] && size=$OPTARG ;;
47 c ) [[ $OPTARG ]] && coredir=$OPTARG ;;
48 - f ) [[ $OPTARG ]] && workdir=$(readlink -f "$OPTARG") ;;
49 + f ) [[ $OPTARG ]] && basedir=$(readlink -f "$OPTARG") ;;
50 h ) usage
51 exit 2
52 ;;
53 @@ -202,6 +204,11 @@ curtime=$starttime
54 while [[ $timeout -eq 0 ]] || [[ $curtime -le $((starttime + timeout)) ]]; do
55 zopt="-VVVVV"
56
57 + # start each run with an empty directory
58 + workdir="$basedir/$rundir"
59 + or_die rm -rf "$workdir"
60 + or_die mkdir "$workdir"
61 +
62 # switch between common arrangements & fully randomized
63 if [[ $((RANDOM % 2)) -eq 0 ]]; then
64 mirrors=2
65 --
66 2.14.2
67