Skip to content

Commit 51efd43

Browse files
mandreetytso
authored andcommitted
Accept alternate ordering of ACLs from btrfs.
#158 Signed-off-by: Matthias Andree <matthias.andree@gmx.de> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
1 parent 2ac7b68 commit 51efd43

File tree

2 files changed

+124
-2
lines changed

2 files changed

+124
-2
lines changed

tests/m_rootdir_acl/expect2

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
Filesystem volume name: <none>
2+
Last mounted on: <not available>
3+
Filesystem magic number: 0xEF53
4+
Filesystem revision #: 1 (dynamic)
5+
Filesystem features: has_journal ext_attr resize_inode dir_index filetype extent 64bit flex_bg inline_data sparse_super huge_file dir_nlink extra_isize metadata_csum
6+
Default mount options: (none)
7+
Filesystem state: clean
8+
Errors behavior: Continue
9+
Filesystem OS type: Linux
10+
Inode count: 1024
11+
Block count: 16384
12+
Reserved block count: 819
13+
Overhead clusters: 1799
14+
Free blocks: 14533
15+
Free inodes: 1003
16+
First block: 1
17+
Block size: 1024
18+
Fragment size: 1024
19+
Group descriptor size: 64
20+
Reserved GDT blocks: 127
21+
Blocks per group: 8192
22+
Fragments per group: 8192
23+
Inodes per group: 512
24+
Inode blocks per group: 256
25+
Flex block group size: 16
26+
Mount count: 0
27+
Check interval: 15552000 (6 months)
28+
Reserved blocks uid: 0
29+
Reserved blocks gid: 0
30+
First inode: 11
31+
Inode size: 512
32+
Required extra isize: 32
33+
Desired extra isize: 32
34+
Journal inode: 8
35+
Default directory hash: half_md4
36+
Journal backup: inode blocks
37+
Checksum type: crc32c
38+
Journal features: (none)
39+
Total journal size: 1024k
40+
Total journal blocks: 1024
41+
Max transaction length: 1024
42+
Fast commit length: 0
43+
Journal sequence: 0x00000001
44+
Journal start: 0
45+
46+
47+
Group 0: (Blocks 1-8192)
48+
Primary superblock at 1, Group descriptors at 2-2
49+
Reserved GDT blocks at 3-129
50+
Block bitmap at 130 (+129)
51+
Inode bitmap at 132 (+131)
52+
Inode table at 134-389 (+133)
53+
7495 free blocks, 491 free inodes, 5 directories, 491 unused inodes
54+
Free blocks: 698-8192
55+
Free inodes: 22-512
56+
Group 1: (Blocks 8193-16383) [INODE_UNINIT]
57+
Backup superblock at 8193, Group descriptors at 8194-8194
58+
Reserved GDT blocks at 8195-8321
59+
Block bitmap at 131 (bg #0 + 130)
60+
Inode bitmap at 133 (bg #0 + 132)
61+
Inode table at 390-645 (bg #0 + 389)
62+
7038 free blocks, 512 free inodes, 0 directories, 512 unused inodes
63+
Free blocks: 9346-16383
64+
Free inodes: 513-1024
65+
debugfs: stat /emptyfile
66+
Inode: III Type: regular
67+
Size: 0
68+
Fragment: Address: 0 Number: 0 Size: 0
69+
debugfs: stat /bigfile
70+
Inode: III Type: regular
71+
Size: 32768
72+
Fragment: Address: 0 Number: 0 Size: 0
73+
debugfs: stat /sparsefile
74+
Inode: III Type: regular
75+
Size: 1073741825
76+
Fragment: Address: 0 Number: 0 Size: 0
77+
debugfs: stat /bigzerofile
78+
Inode: III Type: regular
79+
Size: 1073741825
80+
Fragment: Address: 0 Number: 0 Size: 0
81+
debugfs: stat /fifo
82+
debugfs: stat /emptydir
83+
Inode: III Type: directory
84+
Size: 60
85+
Fragment: Address: 0 Number: 0 Size: 0
86+
debugfs: stat /dir
87+
Inode: III Type: directory
88+
Size: 60
89+
Fragment: Address: 0 Number: 0 Size: 0
90+
debugfs: stat /dir/file
91+
Inode: III Type: regular
92+
Size: 8
93+
Fragment: Address: 0 Number: 0 Size: 0
94+
debugfs: stat /acl_dir
95+
Inode: III Type: directory
96+
Size: 60
97+
Fragment: Address: 0 Number: 0 Size: 0
98+
debugfs: stat /acl_dir/file
99+
Inode: III Type: regular
100+
Size: 10
101+
Fragment: Address: 0 Number: 0 Size: 0
102+
debugfs: ea_list dir/file
103+
Extended attributes:
104+
system.data (0)
105+
debugfs: ea_list acl_dir
106+
Extended attributes:
107+
system.data (0)
108+
system.posix_acl_default (28) = 01 00 00 00 01 00 07 00 04 00 05 00 08 00 05 00 04 00 00 00 10 00 05 00 20 00 05 00
109+
system.posix_acl_access (28) = 01 00 00 00 01 00 07 00 04 00 05 00 08 00 05 00 2a 00 00 00 10 00 05 00 20 00 05 00
110+
debugfs: ea_list acl_dir/file
111+
Extended attributes:
112+
system.data (0)
113+
system.posix_acl_access (28) = 01 00 00 00 01 00 07 00 04 00 05 00 08 00 05 00 2a 00 00 00 10 00 05 00 20 00 05 00
114+
Pass 1: Checking inodes, blocks, and sizes
115+
Pass 2: Checking directory structure
116+
Pass 3: Checking directory connectivity
117+
Pass 4: Checking reference counts
118+
Pass 5: Checking group summary information
119+
test.img: 21/1024 files (0.0% non-contiguous), 1851/16384 blocks

tests/m_rootdir_acl/script

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ fi
1919
MKFS_DIR=$(mktemp -d ./$test_name-XXXXXX.tmp)
2020
OUT=$test_name.log
2121
EXP=$test_dir/expect
22+
EXP2=$test_dir/expect2 # work around btrfs ordering, https://github.com/tytso/e2fsprogs/issues/158
2223

2324
touch $MKFS_DIR/emptyfile
2425
dd if=/dev/zero bs=1024 count=32 2> /dev/null | tr '\0' 'a' > $MKFS_DIR/bigfile
@@ -95,7 +96,7 @@ sed -f $cmd_dir/filter.sed -f $test_dir/output.sed -e "s;$TMPFILE;test.img;" < $
9596
mv $OUT.tmp $OUT
9697

9798
# Do the verification
98-
cmp -s $OUT $EXP
99+
cmp -s $OUT $EXP || cmp -s $OUT $EXP2
99100
status=$?
100101

101102
if [ "$status" = 0 ] ; then
@@ -104,7 +105,9 @@ if [ "$status" = 0 ] ; then
104105
else
105106
echo "$test_name: $test_description: failed"
106107
diff $DIFF_OPTS $EXP $OUT > $test_name.failed
108+
echo " --- alternate $EXP2 ---" >> $test_name.failed
109+
diff $DIFF_OPTS $EXP2 $OUT >> $test_name.failed
107110
fi
108111

109112
rm -rf $TMPFILE.cmd $MKFS_DIR
110-
unset MKFS_DIR OUT EXP
113+
unset MKFS_DIR OUT EXP EXP2

0 commit comments

Comments
 (0)