Test to verify that the on-disk file size is updated correctly.
[xfstests-dev.git] / 135
1 #! /bin/sh
2 # FSQA Test No. 133
3 #
4 # Concurrent I/O to same file to ensure no deadlocks
5 #
6 #-----------------------------------------------------------------------
7 #  Copyright (c) 2006 Silicon Graphics, Inc.  All Rights Reserved.
8 #-----------------------------------------------------------------------
9 #
10 # creator
11 owner=lachlan@sgi.com
12
13 seq=`basename $0`
14 echo "QA output created by $seq"
15
16 here=`pwd`
17 tmp=/tmp/$$
18 status=1    # failure is the default!
19 trap "_cleanup; exit \$status" 0 1 2 3 15
20
21 _cleanup()
22 {
23     _cleanup_testdir
24 }
25
26 # get standard environment, filters and checks
27 . ./common.rc
28 . ./common.filter
29
30 # real QA test starts here
31 _supported_fs xfs
32 _supported_os Linux IRIX
33
34 _setup_testdir
35
36 _umount_mount()
37 {
38     CWD=`pwd`
39     cd /
40     umount $SCRATCH_MNT
41     _scratch_mount
42     cd "$CWD"
43 }
44
45 # create file with async I/O
46 xfs_io -f -c 'pwrite -b 4k -S 0x12 0 4k' async_file > /dev/null
47
48 # create file with sync I/O
49 xfs_io -f -s -c 'pwrite -b 4k -S 0x34 0 4k' sync_file > /dev/null
50
51 # create file with sync I/O
52 xfs_io -f -d -c 'pwrite -b 4k -S 0x56 0 4k' direct_file > /dev/null
53
54 _umount_mount
55
56 # check file size and contents
57 od -Ad -x async_file
58 od -Ad -x sync_file
59 od -Ad -x direct_file
60
61 rm -f async_file sync_file direct_file
62
63 status=0
64 exit