aboutsummaryrefslogtreecommitdiffstats
path: root/tests/xfs/557
blob: 01205377b73a63f90c2338613f7683c13a6bb3d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#! /bin/bash
# SPDX-License-Identifier: GPL-2.0
# Copyright (c) 2022 Fujitsu Limited. All Rights Reserved.
#
# FS QA Test No. 557
#
# This is a test for:
#   bf3cb3944792 (xfs: allow single bulkstat of special inodes)
# Create a filesystem which contains an inode with a lower number
# than the root inode. Then verify that XFS_BULK_IREQ_SPECIAL_ROOT gets
# the correct root inode number.
#
. ./common/preamble
_begin_fstest auto quick prealloc

_supported_fs xfs
_require_xfs_io_command "falloc"
_require_xfs_io_command "bulkstat_single"
_require_scratch

_fixed_by_kernel_commit 817644fa4525 \
	"xfs: get root inode correctly at bulkstat"

# Create a filesystem which contains a fake root inode
inums=($(_scratch_xfs_create_fake_root))
root_inum=${inums[0]}
fake_inum=${inums[1]}

# Get root ino with XFS_BULK_IREQ_SPECIAL_ROOT
bulkstat_root_inum=$($XFS_IO_PROG -c 'bulkstat_single root' $SCRATCH_MNT | grep bs_ino | awk '{print $3;}')
echo "bulkstat_root_inum: $bulkstat_root_inum" >> $seqres.full
if [ $root_inum -ne $bulkstat_root_inum ]; then
	echo "root ino mismatch: expected:${root_inum}, actual:${bulkstat_root_inum}"
fi

echo "Silence is golden"

# success, all done
status=0
exit