[PATCH] generic/399: Use dd instead of xfs_io pwrite to fill volume

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]



As recently discussed on the fstests mailing list, the way
generic/399 checks for the filesystem having become full only
works on filesystems that behave like ext4, and even on those,
actually only works by accident.

The problem is that xfs_io does not give a nonzero exit value
when the pwrite operation fails due to ENOSPC. However, if the
filesystem also happens to be unable to create new empty files
when it is full, the check will do its job because open() fails
with ENOSPC. Not all filesystems behave like this, however.

As it seems to be nontrivial to get xfs_io fixed for this case,
I propose simply replacing the xfs_io pwrite command with dd
for now. AFAICS, this works with all filesystems, and should also
preserve the nature of the test case.

Signed-off-by: Ari Sundholm <ari@xxxxxxxxxx>
---
 tests/generic/399 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/generic/399 b/tests/generic/399
index 8f5fcdc..5056b20 100755
--- a/tests/generic/399
+++ b/tests/generic/399
@@ -101,7 +101,7 @@ total_file_size=0
 i=1
 while true; do
 	file=$SCRATCH_MNT/encrypted_dir/file$i
-	if ! $XFS_IO_PROG -f $file -c 'pwrite 0 1M' &> $tmp.out; then
+	if ! dd if=/dev/zero of=$file bs=4k count=256 &> $tmp.out; then
 		if ! grep -q 'No space left on device' $tmp.out; then
 			echo "FAIL: unexpected pwrite failure"
 			cat $tmp.out
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux