xfs/007: fix regressions on V4 filesystems
[xfstests-dev.git] / tests / xfs / 053
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2015 Red Hat, Inc.  All Rights Reserved.
4 #
5 # FS QA Test 053
6 #
7 # Ensure that xfs_repair can properly spot SGI_ACL_FILE
8 # and SGI_ACL_DEFAULT in the root attr namespace.
9 #
10 # Due to bugs here and there, we sometimes matched on partial
11 # strings with those names, and threw off xfs_repair.
12 #
13 . ./common/preamble
14 _begin_fstest attr acl repair quick auto
15
16 # Import common functions.
17 . ./common/filter
18 . ./common/attr
19
20 # real QA test starts here
21
22 _supported_fs xfs
23 _require_scratch
24 _require_attrs
25
26 _scratch_mkfs >/dev/null 2>&1
27 _scratch_mount
28
29 # Create root attr names which are substrings or superstrings
30 # of the reserved ACL names, and make sure xfs_repair copes.
31
32 # Due to various bugs, either the compared length was shorter
33 # than the reserved name (7 chars), so substrings matched, and/or only
34 # the reserved name length was compared, so superstrings matched.
35
36 rm -f $SCRATCH_MNT/$seq.*
37
38 # actual reserved names:
39 #           SGI_ACL_FILE        SGI_ACL_DEFAULT
40 for NAME in SGI_ACL \
41             SGI_ACL_F           SGI_ACL_D \
42             SGI_ACL_FILE_FOO    SGI_ACL_DEFAULT_FOO; do
43         touch $SCRATCH_MNT/${seq}.${NAME}
44         $ATTR_PROG -R -s $NAME -V "Wow, such $NAME" $SCRATCH_MNT/$seq.$NAME \
45                 | _filter_scratch
46 done
47
48 # Older repair failed because it sees the above names as matching
49 # SGI_ACL_FILE / SGI_ACL_DEFAULT but w/o valid acls on them
50
51 # The test harness will catch this (false positive) corruption
52
53 # success, all done
54 status=0
55 exit