I've been periodically failing btrfs/003 because my box sometimes takes a little
longer to unregister the device when we remove it and so the output from btrfs
dev show doesn't match what we are wanting since it still sees the device. To
fix this just stat and sleep if we still see the device node and only continue
once udev or whatever actually removes the device node so that we don't get
random failures.
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
I noticed this test was hanging because mkfs.ext4 wanted to make sure it was ok
to mkfs an entire device. We need -F so it doesn't ask this question. Thanks,
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
We changed btrfs device add to check and see if there is an existing fs on the
device we are adding, so you now have to do -f if you want to do this. In order
to get around checking to see if we have this version of btrfs-progs just wipefs
the device we're adding to make sure the device add will pass no matter which
version of btrfs-progs you have. Thanks,
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
Test xfs/016 fails to run due to invalid mkfs options. The log size
is reported as too small according to the minimum log size
calculation:
log size 512 blocks too small, minimum size is 853 blocks
Update log_size to the currently specified minimum.
Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
A user reported a regression where we could no longer rename a subvolume into
another subvolume. This is a test case to do just that to make sure we don't
regress on this again.
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
We had a regression where you couldn't snapshot a file system if you mounted it
ro and then remounted it rw. This is a test that does just that to make sure we
don't have this problem again. I ran the test without the fix and it blew up,
and then applied the fix and verified that it passed. Thanks,
Reviewed-by: Stefan Behrens <sbehrens@giantdisaster.de>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
I recently added a patch to avoid sending holes with btrfs send, but I screwed
it up by not sending a hole when we did a hole punch. This is an xfstest
version of the test I wrote to show that I had a bug and to verify I was fixing
it properly. This test properly fails with my old patch and passes with my good
patch. Thanks,
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
This test doesn't need the scratch dev pool and it also doesn't call
_require_scratch_dev_pool, so just kick out the scratch dev pool part of the
test. Thanks,
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
In some cases selinux's creation of an xattr on the temporary
fd creates a local xattr, but the file we are trying to
defragment has attrs in extent format, and the forkoff mismatch
will cause xfs_fsr to fail. This test demonstrates it; I
have old patches sent to the list long ago that should fix
it. I'll resend them soon.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
We had a regression where you couldn't snapshot a file system if
you mounted it ro and then remounted it rw. This is a test that
does just that to make sure we don't have this problem again. I
ran the test without the fix and it blew up, and then applied the
fix and verified that it passed.
[rjohnston: renumbered test]
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Reviewed-by: Stefan Behrens <sbehrens@giantdisaster.de>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
Btrfs will default to mixed block groups for 1 gigabyte file systems and
smaller, which means data and metadata share the same area. This makes
generic/274 fail for us because we cannot reserve enough metadata space to do
our writes. Bumping the scratch fs up to 2 gigabytes allows us to do our normal
metadata/data separation and allows us to pass this test. Thanks,
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
This test is motivated by an issue found by a btrfs user, addressed
and described by the following Linux kernel patch:
https://patchwork.kernel.org/patch/3046931/
The steps to reproduce the issue on btrfs are the following:
$ mkfs.btrfs -f /dev/loop0
$ mount /dev/loop0 /mnt
$ mkdir /mnt/acl
$ setfacl -d --set u::rwx,g::rwx,o::- /mnt/acl
$ getfacl /mnt/acl
user::rwx
group::rwx
other::r-x
default:user::rwx
default:group::rwx
default:other::---
$ mkdir /mnt/acl/dir1
$ getfacl /mnt/acl/dir1
user::rwx
group::rwx
other::---
After unmounting and mounting again the filesystem, getfacl returned the
expected default ACL for the subdirectory:
$ umount /mnt/acl
$ mount /dev/loop0 /mnt
$ getfacl /mnt/acl/dir1
user::rwx
group::rwx
other::---
default:user::rwx
default:group::rwx
default:other::---
This means that the underlying ACL xattr was persisted correctly but
the in memory representation of the inode had (incorrectly) a NULL ACL.
[rjohnston: renumbered test to 319]
Signed-off-by: Filipe David Borba Manana <fdmanana@gmail.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
test xfs/205 expects a certain log size, but defaults have
changed, the logs are bigger, and this test now fails w/ early
ENOSPC:
QA output created by 205
+ !!! disk full (expected)
+ !!! disk full (expected)
+ !!! disk full (expected)
*** one file
+ !!! disk full (expected)
*** one file, a few bytes at a time
...
Fix this by specifying the log size at mkfs time, so freespace is
as the test expects it to be.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
Originally, when executing "btrfs balance" right after
"btrfs subvolume snaphot" & "btrfs subvolume delete",
a kernel BUG arises.
This problem is caused by the patch:
[PATCH 1/2] Btrfs: fix for patch "cleanup: don't check
the same thing twice"
The commit id: 48475471728f060bfd2e686f592ef208d3ba8b7d
(in kernel/git/torvalds/linux.git)
handled by the patch:
[PATCH 2/3] Btrfs: fix oops caused by the space balance
and dead roots
[rjohnston: change test number to 14]
Signed-off-by: Gui Hecheng <guihc.fnst@cn.fujitsu.com>
Reviewed-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
Current version of AC_PACKAGE_WANT_NDBM has following bugs:
* a typo (',') next to 'gdbm/ndbm.h', so C compiler fails
with a syntax error when trying to compile
"#include <gdbm/ndbm.h,>"
* autoconf never defines HAVE_GDBM_NDBM_H_ because it
converts both header names (gdbm/ndbm.h, gdbm-ndbm.h)
to GDBM_NDBM_H
Because of these bugs 'dbtest' can't be compiled on systems where
'gdbm-ndbm.h' header is absent but 'gdbm/ndbm.h' is present.
Fixed this.
Signed-off-by: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
Long device names may be split onto their own line
on quota output:
Filesystem Blocks Quota Limit Warn/Time Mounted on
/dev/mapper/my-very-very-very-long-devicename
48M 0 0 00 [------] /mnt/scratch
which breaks tests that capture quota output - currently,
only xfs/108.
Add a _filter_quota() which fixes this.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
The mount binary changed its output w.r.t. red-only devices, and
stopped referring to a "block device."
This broke at least test xfs/200; add a common filter to remove
the "block device" from older mount binary output, and change
the 200.out file to match.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
test 294 is using the scratch device w/o mkfs-ing it first,
this runs the risk of following a test which completely
fills the fs, causing 294 to fail.
add "rm -f $seqres.full" as well, it was growing on every run.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
Test 259 tries to make a loop device size which is 1 byte less
than 4T; losetup now warns that this makes little sense, and
the warning breaks the test output:
+losetup: /mnt/test/259.image: warning: file does not fit into a 512-byte sector the end of the file will be ignored.
The RH QE testcase did originally use loopback, so did
not in effect test anything other than 512-multiple boundaries.
Just drop the non-512-byte-multiple cases, they produce
devices exactly the same size as their 512-byte-multiple
neighbors.
(FWIW, this is a regression test for the bug that
d943b11 mkfs: get size of device properly
fixed.)
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
Starting from util-linux v2.23 fstrim(1) reports trimmed bytes
differently, e.g.
new fstrim: /mnt/ext4: 9.7 GiB (10411118592 bytes) trimmed
old fstrim: /mnt/ext4: 10411118592 bytes were trimmed
generic/260 reports syntax error
+./tests/generic/260: line 111: [: 9.7: integer expression expected
+./tests/generic/260: line 121: [: 9.7: integer expression expected
+./tests/generic/260: line 183: [: 9.7: integer expression expected
Add a new filter called _filter_fstrim in common/filter and get the
correct trimmed bytes in generic/260, so the test passes with both old
and new fstrim.
Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
We had a regression where we were not copying csums properly when balancing a
prealloc extent. Unfortunately the way this showed up the most was with the
csum simply missing, which doesn't result in an error to userspace. So I've
copied what generic/310 does and check dmesg for csum errors when the test
starts and then compare that count to the csum errors after the test finishes to
see if there was a problem. This approach caught the error without my fix, and
then passed fine with my fix in place but with the previous errors still in
dmesg. Thanks,
[rjohnston: changed test number to 13]
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Reviewed-by: Stefan Behrens <sbehrens@giantdisaster.de>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
With coreutils v8.16 the style of apostrophes changed from `word' to
'word'. This is breaking some tests which use the older form.
This commit introduces function changes the golden output of the
affected tests and introduces a filter for the older style output.
[dchinner: modified to use a global filter in check rather than
per-test filters]
[rjohnston: minor comment change]
Signed-off-by: Tomas Racek <tracek@redhat.com>
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
We were actually testing this improperly, there was a bug in the set default
code so we weren't actually honoring the 0 subvolid properly. To fix this we
need to get the subvolid for the subvol we want to set as the default and use
that in the command. With this patch we now pass again with the fix for the 0
subvolid. Thanks,
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Tested-by: David Sterba <dsterba@suse.cz>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
_scratch_mkfs_sized requires an integer number of bytes
as input; if it's given something else, catch it and _notrun.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>