The following kernel commit introduced the bug:
51f395ad btrfs: Use right extent length when inserting overlap extent map.
When btrfs commit race with btrfs_get_extent(), merge_extent_mapping()
may build up a new extent which length overflows and cause extent map
insert fail, causing the caller get a -EEXIST error.
This regression is fixed by the following patches:
btrfs: Fix and enhance merge_extent_mapping() to insert best fitted extent map
btrfs: Fix the wrong condition judgment about subset extent map
Cc: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Tested-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Regression test for a btrfs issue where creation of readonly snapshots caused
the filesystem to get into an inconsistent state.
This regression was introduced in the 3.17 kernel and fixed by reverting the
following linux kernel commit:
Btrfs: race free update of commit root for ro snapshots
9c3b306e1c9e6be4be09e99a8fe2227d1005effc
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
This test creates a large-ish directory structure using
fsstress, and does a dump/restore to make sure we dump
all the files.
Without the fix for the regression caused by:
c7cb51d xfs: fix error handling at xfs_inumbers
we will see failures like:
-xfsrestore: 486 directories and 1590 entries processed
+xfsrestore: 30 directories and 227 entries processed
as it fails to process all inodes.
I think that existing tests have a much smaller set of files,
and so don't trip the bug.
I don't do a file-by-file comparison here, because for some
reason the diff output gets garbled; this test only checks
that we've dumped & restored the correct number of files.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
XFS buffered I/O writeback has a subtle race condition that leads to
stale data exposure if the filesystem happens to crash after delayed
allocation blocks are converted on disk and before data is written back
to said blocks.
Use file allocation commands to attempt to reproduce a related, but
slightly different variant of this problem. The associated falloc
commands can lead to partial writeback that converts an extent larger
than the range affected by falloc. If the filesystem crashes after the
extent conversion but before all other cached data is written to the
extent, stale data can be exposed.
Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
This is a regression test for a btrfs incremental send issue.
If between two snapshots we rename an existing directory named X to Y and
make it a child (direct or not) of a new inode named X, we were delaying
the move/rename of the former directory unnecessarily, which would result
in attempting to rename the new directory from its orphan name to name X
prematurely. This made btrfs receive fail with an error message like the
following:
rename o261-7-0 -> merlin/RC/OSD failed
This issue was a regression in the 3.16 kernel and got fixed by the
following linux kernel btrfs patch:
Btrfs: send, don't delay dir move if there's a new parent inode
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
while running ./check tests/shared/032, it outputs something like:
FSTYP -- btrfs
PLATFORM -- Linux/x86_64 vm01 3.17.0-rc5+
MKFS_OPTIONS -- /dev/sdc
MOUNT_OPTIONS -- /dev/sdc /mnt/scratch
shared/032 2s ... 2s
_check_btrfs_filesystem: filesystem on /dev/sdc is inconsistent (see /root/xfstests-dev/results//shared/032.full)
Ran: shared/032
Passed all 1 tests
This is because xfstests will run fsck after each unit test,
for tests/shared/032, we have reformated SCRATCH_DEV to other fs,
fix this problem by skipping fsck here.
Signed-off-by: Wang Shilong <wangshilong1991@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
83ef157 (common: Check fs consistency on TEST_DEV only when needed) has
_require_test unconditionally return _notrun when testing on an NFS
filesystem, essentially disabling NFS. This patch changes the code to
validate $TEST_DEV and only call _notrun if validation fails.
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
If the device name is too long, the output of xfs_quota -c "df" will be
broke into two lines as
Filesystem 1K-blocks Used Available Use% Pathname
/dev/mapper/rhel_hp--dl388eg8--01-testlv2
15718400 32932 15685468 0% /mnt/testarea/scratch
/dev/mapper/rhel_hp--dl388eg8--01-testlv2
512000 0 512000 0% /mnt/testarea/scratch/test
and _filter_quota_rpt() couldn't catch the correct available number and
test will fail as
[root@hp-dl388g8-01 xfstests]# diff -u tests/xfs/262.out /root/xfstests/results//xfs/262.out.bad
--- tests/xfs/262.out 2014-10-08 20:16:19.000000000 +0800
+++ /root/xfstests/results//xfs/262.out.bad 2014-10-09 14:29:38.795813323 +0800
@@ -1,2 +1,4 @@
QA output created by 262
Silence is golden.
+hard limit 0 bytes, expected 524288000
+hard limit 0 bytes, expected 524288000
Update the filter so it could catch the correct value.
Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
This test add a regression test to make sure btrfs dosen't set
inode NOCOMPRESS flag when a small write(<=blocksize) happens.
Signed-off-by: Wang Shilong <wangshilong1991@gmail.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
If one subvolume was mounted with selinux context, other subvolumes
should be able to be mounted with the same selinux context too.
Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Testing if FSSTRESS_PROG is a null string dosen't make sense because
it has just been set.
Here fix it by testing if it is an executable file.
Signed-off-by: Wang Shilong <wangshilong1991@gmail.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Run btrfs defrag operations and remount with different compress
algorithms simultaneously with fsstress running in background.
Reviewed-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Run btrfs scrub and remount with different compress algorithms
simultaneously with fsstress running in background.
Reviewed-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Run btrfs scrub and defrag operations simultaneously with fsstress
running in background.
Reviewed-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Run btrfs replace operations and remount with different compress
algorithms simultaneously with fsstress running in background.
Reviewed-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Run btrfs replace operations and defrag simultaneously with fsstress
running in background.
Reviewed-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Run btrfs replace operations and scrub simultaneously with fsstress
running in background.
Reviewed-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Run btrfs subvolume create/mount/umount/delete and remount with
different compress algorithms simultaneously, with fsstress running in
background.
Reviewed-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Run btrfs subvolume create/mount/umount/delete and btrfs defrag
operations simultaneously, with fsstress running in backgound.
Reviewed-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Run btrfs subvolume create/mount/umount/delete and btrfs scrub
operation simultaneously, with fsstress running in background.
Reviewed-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Run btrfs subvolume create/mount/umount/delete and device replace
operation simultaneously, with fsstress running in background.
Reviewed-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Run btrfs balance and replace operations simultaneously with fsstress
running in background.
Reviewed-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Run btrfs balance and remount with different compress algorithms
simultaneously, with fsstress running in background.
Reviewed-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Run btrfs balance and defrag operations simultaneously with fsstress
running in background.
Reviewed-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>