pv 955274 - Limit the offset passed to dm_write_invis() to the file size to avoid
[xfstests-dev.git] / 076
1 #! /bin/sh
2 # FS QA Test No. 076
3 #
4 # Test blockdev reads in parallel with filesystem reads/writes
5 #
6 #-----------------------------------------------------------------------
7 #  Copyright (c) 2000-2004 Silicon Graphics, Inc.  All Rights Reserved.
8 #-----------------------------------------------------------------------
9 #
10 # creator
11 owner=nathans@sgi.com
12
13 seq=`basename $0`
14 echo "QA output created by $seq"
15
16 here=`pwd`
17 tmp=/tmp/$$
18 status=1
19
20 _lets_get_pidst()
21 {
22         if [ -n "$pid" ]; then
23                 kill -TERM $pid 2>/dev/null
24                 pid=""
25                 wait 2>/dev/null
26         fi
27 }
28
29 _cleanup()
30 {
31         echo "*** unmount"
32         umount $SCRATCH_MNT 2>/dev/null
33         _lets_get_pidst
34 }
35 trap "_cleanup; rm -f $tmp.*; exit \$status" 0 1 2 3 15
36
37 # get standard environment, filters and checks
38 . ./common.rc
39 . ./common.filter
40
41 # real QA test starts here
42 _supported_fs xfs udf
43 _supported_os IRIX Linux
44
45 _require_scratch
46
47 echo "*** init fs"
48
49 rm -f $seq.full
50 umount $SCRATCH_DEV >/dev/null 2>&1
51 echo "*** MKFS ***"                         >>$seq.full
52 echo ""                                     >>$seq.full
53 _scratch_mkfs                               >>$seq.full 2>&1 \
54         || _fail "mkfs failed"
55 _scratch_mount                              >>$seq.full 2>&1 \
56         || _fail "mount failed"
57
58 echo "*** test concurrent block/fs access"
59
60 cat $SCRATCH_DEV >/dev/null &
61 pid=$!
62
63 $FSSTRESS_PROG -d $SCRATCH_MNT -p 2 -n 2000 $FSSTRESS_AVOID >>$seq.full
64
65 _lets_get_pidst
66 _check_scratch_fs
67
68 echo "*** done"
69 status=0
70 exit