Bad characters likes tailing asterisk, slash or quote in xfs_db
field string can trigger a xfs_db crash. This bug has been fixed by
xfsprogs commit 945e47e2fcc5 ("xfs_db: fix crash when field list
selector string has trailing slash").
Signed-off-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Test that if a power failure happens on a filesystem with quotas
(qgroups) enabled while the quota rescan kernel thread is running,
we will be able to mount the filesystem after the power failure.
This test is motivated by a recent regression introduced in the
linux kernel's 4.18 merge window and is fixed by a patch with the
title:
"Btrfs: fix mount failure when qgroup rescan is in progress"
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Run several duperemove processes with fsstress on same directory at
same time. Make sure the race won't break the fs or kernel.
Signed-off-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
This case does dedupe on a dir, then copy the dir to next dir.
Dedupe the next dir again, then copy this dir to next again, and
dedupe again ... At the end, verify the data in the last dir is
still same with the first one.
Signed-off-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Duperemove is a tool for finding duplicated extents and submitting
them for deduplication, and it supports XFS. This case trys to
verify the integrity of XFS after running duperemove.
Signed-off-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Recently we found out xfs_repair were not repairing root inode
parent pointer when root inode is on short-form and parent points to
an invalid inode number (refer to: "xfs_repair: Fix root inode's
parent when it's bogus for sf directory" on xfs-devel list).
This test checks if xfs_repair successfully repair the filesystem in
the scenario mentioned before.
Signed-off-by: Marco Benatto <mbenatto@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
In "xfs: fix fdblocks accounting w/ RMAPBT per-AG reservation", we fixed
the per-ag reservation code so that we always decrease fdblocks by the
reserved size because rmapbt blocks are counted as free space.
The primary symptom of this bug is that if the rmapbt has expanded since
mount time, the disk block counters reported via statfs will change
across a remount. Therefore, we exercise this as a regression test.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
In kernel patch "xfs: verify root inode more thoroughly", we strengthen
the root inode mount checks to make sure that the inobt agrees that the
root inode exists and is in use. Unfortunately, that makes this whole
test useless because we can't even mount the filesystem to run scrub.
So, redirect it to AG1's inobt.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Move get_sfdir_prefix function from xfs/278 to commom/xfs
and rename it to _scratch_get_sfdir_prefix so it can be
used in other xfs tests.
This commit also changes xfs/278 to make use of
_scratch_get_sfdir_prefix instead previous one.
Signed-off-by: Marco Benatto <mbenatto@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Since btrfs-dump-tree has been removed from btrfs-progs, use btrfs
inspect-internal dump-tree instead of btrfs-dump-tree.
Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
xfs/170 always fails on xfs with "-m rmapbt=1,reflink=1", because
XFS need bigger internal log size if rmapbt and reflink are both
enabled.
One line of xfs/170 as below:
_test_streams 8 16 4 8 3 0 0
Refer to common/filestreams, we can see xfs/170 trys to create a
128M XFS (agcount=8, agsize=16M), then each stream writes
24M (8 * 3M files), and there're 4 streams.
So the case expects each stream takes 2 AGs, 4 streams takes
different 8 AGs just enough. But internal log will break this
balance. For example:
"mkfs.xfs -f -b size=4k -m rmapbt=1,reflink=1 $dev" will take 3075
4k blocks (12M) by default:
meta-data=/dev/mapper/xxxx-xfscratch isize=512 agcount=8, agsize=4096 blks
...
log =internal bsize=4096 blocks=3075, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
...
And the internal log is in the 4th AG:
# xfs_logprint: /dev/mapper/xxxx-xfscratch
xfs_logprint:
data device: 0xfd03
log device: 0xfd03 daddr: 131120 length: 24600
# xfs_db -c "convert daddr 131120 agno" /dev/mapper/xxxx-xfscratch
0x4 (4)
Then if one stream write data into AG-1 at first, then turn to AG-4
after fill 16M agsize. But AG-4 has 12M space for log section, so
only 4M free space for data. Then this stream have to turn to the
next AG after fill the 4M space. All these as below:
# xfs_bmap -vp stream2-dir/*
stream2-dir/frame-1:
EXT: FILE-OFFSET BLOCK-RANGE AG AG-OFFSET TOTAL FLAGS
0: [0..6143]: 32960..39103 1 (192..6335) 6144 000000
...
...
stream2-dir/frame-5:
EXT: FILE-OFFSET BLOCK-RANGE AG AG-OFFSET TOTAL FLAGS
0: [0..6143]: 57536..63679 1 (24768..30911) 6144 000000
stream2-dir/frame-6:
EXT: FILE-OFFSET BLOCK-RANGE AG AG-OFFSET TOTAL FLAGS
0: [0..6143]: 155776..161919 4 (24704..30847) 6144 000000
stream2-dir/frame-7:
EXT: FILE-OFFSET BLOCK-RANGE AG AG-OFFSET TOTAL FLAGS
0: [0..6143]: 170088..176231 5 (6248..12391) 6144 000000
stream2-dir/frame-8:
EXT: FILE-OFFSET BLOCK-RANGE AG AG-OFFSET TOTAL FLAGS
0: [0..6143]: 176232..182375 5 (12392..18535) 6144 000000
Later _test_streams maybe takes AG-5 again, and cause two streams use
AG-5. To avoid this failure, increase the agsize from 16M to 22M,
others stay the same, each stream still writes 2 AGs. Even internal
log takes some space from someone AG, left space should be enough to
write (24 - 22)=2M data.
Signed-off-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Add btrfs test that checks "rmdir" or "rm -r" command can delete a
subvolume like an ordinary directory.
This behavior has been restricted long time but becomes allowed by
kernel commit a79a464d5675 ("btrfs: Allow rmdir(2) to delete an
empty subvolume")
The test will be skipped if kernel does not support the feature,
which can be checked whether /sys/fs/btrfs/features/rmdir_subvol
exists or not.
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: Misono Tomohiro <misono.tomohiro@jp.fujitsu.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Test that if we create a new hard link for a file which was
previously fsync'ed, fsync a parent directory of the new hard link
and power fail, the parent directory exists after mounting the
filesystem again. The parent directory must be a new directory, not
yet persisted.
This test is motivated by a bug found in btrfs, where the fsync'ed
parent directory was lost after a power failure. The bug in btrfs is
fixed by a patch for the linux kernel titled:
"Btrfs: sync log after logging new name"
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
On filesystems that do not support O_DIRECT, the test should skip
itself with
generic/391 [not run] O_DIRECT is not supported
instead of failing with
generic/391 - output mismatch ...
...
+open: Invalid argument
Silence is golden
...
This patch make it do that by adding a call to _require_odirect.
Fixes https://github.com/rfjakob/gocryptfs/issues/244 .
Signed-off-by: Jakob Unterwurzacher <jakobunt@gmail.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Fully scripted conversion, see script in initial SPDX license commit
message.
tests/xfs/044 was hand massaged to remove duplicate copyright and
divider lines before running the script.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Make sure that all of our commands that can print geometry
information all print the /same/ information.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Abstract calls to xfs_info into $XFS_INFO_PROG like we do for all
other xfs utilities.
[Eryu: require xfs_info to be present if FSTYP is xfs]
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
In xfs/310 we have to _require_scratch_nocheck last because anything
else that calls _require_scratch (e.g. _require_xfs_scratch_rmapbt)
will create the "check scratch after test exit" file.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
We recently redefined sb_fname's array length to use a symbolic
constant instead of a magic number, so update this test accordingly.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>