fstests: check for filesystem FS_IOC_FSSETXATTR support
[xfstests-dev.git] / tests / xfs / 095
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2000-2004 Silicon Graphics, Inc.  All Rights Reserved.
4 #
5 # FS QA Test No. 095
6 #
7 # Test upgrading the XFS log to v2
8 #
9 seq=`basename $0`
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
12
13 here=`pwd`
14 tmp=/tmp/$$
15 status=1        # failure is the default!
16 trap "_cleanup; exit \$status" 0 1 2 3 15
17
18 _cleanup()
19 {
20     cd /
21     rm -f $tmp.*
22 }
23
24 # get standard environment, filters and checks
25 . ./common/rc
26 . ./common/filter
27 . ./common/log
28
29 # real QA test starts here
30
31 # Modify as appropriate.
32 _supported_fs xfs
33 _supported_os Linux
34 _require_scratch
35 _require_v2log
36
37 if [ "$(blockdev --getss $SCRATCH_DEV)" != "512" ]; then
38         _notrun "need 512b sector size"
39 fi
40
41 export MOUNT_OPTIONS="-o logbsize=64k"
42
43 # try and mount a v1 log with a v2 LRsize
44 # expect failure
45 _mkfs_log "-l version=1 -m crc=0 -d sectsize=512"
46 _scratch_xfs_db -c 'version' | tr ',' '\n' | grep LOGV2
47 _create_log
48
49 # now make the fs a v2 fs and try to mount again
50 # it should succeed this time
51 _scratch_xfs_db -x -c 'version log2' | tr ',' '\n' | grep LOGV2
52 _create_log
53
54 # success, all done
55 status=0
56 exit