xfs: force file creation to the data device for certain layout tests
[xfstests-dev.git] / tests / xfs / 197
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2008 Christoph Hellwig.
4 #
5 # FS QA Test No. 197
6 #
7 # Check that d_off can be represented in a 32 bit long type without
8 # truncation.  Note that this test will always succeed on a 64 bit
9 # systems where there is no smaller off_t.
10 #
11 # Based on a testcase from John Stanley <jpsinthemix@verizon.net>.
12 #
13 # http://oss.sgi.com/bugzilla/show_bug.cgi?id=808
14 #
15 seq=`basename $0`
16 seqres=$RESULT_DIR/$seq
17 echo "QA output created by $seq"
18
19 here=`pwd`
20 tmp=/tmp/$$
21 status=1        # failure is the default!
22
23 _cleanup()
24 {
25         rm -rf $TEST_DIR/ttt
26 }
27 trap "_cleanup; exit \$status" 0 1 2 3 15
28
29 # get standard environment, filters and checks
30 . ./common/rc
31 . ./common/filter
32
33 # real QA test starts here
34 _supported_fs xfs
35 _require_test
36
37 bitsperlong=`$here/src/feature -w`
38 if [ "$bitsperlong" -ne 32 ]; then
39         _notrun "This test is only valid on 32 bit machines"
40 fi
41
42 mkdir $TEST_DIR/ttt
43 for n in {1..168}; do
44     touch $TEST_DIR/ttt/$n;
45 done
46 $here/src/t_dir_offset $TEST_DIR/ttt
47
48 # success, all done
49 echo "*** done"
50 rm -f $seqres.full
51 status=0