* [PATCH 1/7] xfs/449: filter out "Discarding..." from output
2020-01-16 5:10 [PATCH 0/7] fstests: random fixes Darrick J. Wong
@ 2020-01-16 5:10 ` Darrick J. Wong
2020-01-16 9:23 ` Christoph Hellwig
2020-01-16 5:10 ` [PATCH 2/7] xfs/122: add disk dquot structure to the list Darrick J. Wong
` (5 subsequent siblings)
6 siblings, 1 reply; 16+ messages in thread
From: Darrick J. Wong @ 2020-01-16 5:10 UTC (permalink / raw)
To: guaneryu, darrick.wong; +Cc: linux-xfs, fstests
From: Darrick J. Wong <darrick.wong@oracle.com>
xfsprogs 5.4 prints "Discarding..." if the disk supports the trim
command. Filter this out of the output because xfs_info and friends
won't print that out.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
tests/xfs/449 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/xfs/449 b/tests/xfs/449
index 7aae1545..83c3c493 100755
--- a/tests/xfs/449
+++ b/tests/xfs/449
@@ -39,7 +39,7 @@ _require_scratch_nocheck
_require_xfs_spaceman_command "info"
_require_command "$XFS_GROWFS_PROG" xfs_growfs
-_scratch_mkfs > $tmp.mkfs
+_scratch_mkfs | sed -e '/Discarding/d' > $tmp.mkfs
echo MKFS >> $seqres.full
cat $tmp.mkfs >> $seqres.full
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 2/7] xfs/122: add disk dquot structure to the list
2020-01-16 5:10 [PATCH 0/7] fstests: random fixes Darrick J. Wong
2020-01-16 5:10 ` [PATCH 1/7] xfs/449: filter out "Discarding..." from output Darrick J. Wong
@ 2020-01-16 5:10 ` Darrick J. Wong
2020-01-16 9:23 ` Christoph Hellwig
2020-01-16 5:10 ` [PATCH 3/7] xfs/507: skip if we can't create a large sparse file for testing Darrick J. Wong
` (4 subsequent siblings)
6 siblings, 1 reply; 16+ messages in thread
From: Darrick J. Wong @ 2020-01-16 5:10 UTC (permalink / raw)
To: guaneryu, darrick.wong; +Cc: linux-xfs, fstests
From: Darrick J. Wong <darrick.wong@oracle.com>
Add disk dquot structures to the check list now that we killed the
typedef.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
tests/xfs/122.out | 1 +
1 file changed, 1 insertion(+)
diff --git a/tests/xfs/122.out b/tests/xfs/122.out
index d2d5a184..91a3bdae 100644
--- a/tests/xfs/122.out
+++ b/tests/xfs/122.out
@@ -81,6 +81,7 @@ sizeof(struct xfs_dir3_free) = 64
sizeof(struct xfs_dir3_free_hdr) = 64
sizeof(struct xfs_dir3_leaf) = 64
sizeof(struct xfs_dir3_leaf_hdr) = 64
+sizeof(struct xfs_disk_dquot) = 104
sizeof(struct xfs_dsymlink_hdr) = 56
sizeof(struct xfs_extent_data) = 24
sizeof(struct xfs_extent_data_info) = 32
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 3/7] xfs/507: skip if we can't create a large sparse file for testing
2020-01-16 5:10 [PATCH 0/7] fstests: random fixes Darrick J. Wong
2020-01-16 5:10 ` [PATCH 1/7] xfs/449: filter out "Discarding..." from output Darrick J. Wong
2020-01-16 5:10 ` [PATCH 2/7] xfs/122: add disk dquot structure to the list Darrick J. Wong
@ 2020-01-16 5:10 ` Darrick J. Wong
2020-01-16 9:24 ` Christoph Hellwig
2020-01-16 5:11 ` [PATCH 4/7] xfs/279: skip test if we can't allocate scsi_debug device Darrick J. Wong
` (3 subsequent siblings)
6 siblings, 1 reply; 16+ messages in thread
From: Darrick J. Wong @ 2020-01-16 5:10 UTC (permalink / raw)
To: guaneryu, darrick.wong; +Cc: linux-xfs, fstests
From: Darrick J. Wong <darrick.wong@oracle.com>
Skip this test we can't create the large sparse file needed to test
overflows.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
tests/xfs/507 | 1 +
1 file changed, 1 insertion(+)
diff --git a/tests/xfs/507 b/tests/xfs/507
index 0bb697f9..fac5d243 100755
--- a/tests/xfs/507
+++ b/tests/xfs/507
@@ -68,6 +68,7 @@ _require_fs_space $SCRATCH_MNT 1234567
loop_file=$SCRATCH_MNT/a.img
loop_mount=$SCRATCH_MNT/a
$XFS_IO_PROG -f -c "truncate $loop_file_sz" $loop_file
+test -s $loop_file || _notrun "Could not create large sparse file"
loop_dev=$(_create_loop_device $loop_file)
# Now we have to create the source file. The goal is to overflow a 32-bit
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 4/7] xfs/279: skip test if we can't allocate scsi_debug device
2020-01-16 5:10 [PATCH 0/7] fstests: random fixes Darrick J. Wong
` (2 preceding siblings ...)
2020-01-16 5:10 ` [PATCH 3/7] xfs/507: skip if we can't create a large sparse file for testing Darrick J. Wong
@ 2020-01-16 5:11 ` Darrick J. Wong
2020-01-16 9:24 ` Christoph Hellwig
2020-01-16 5:11 ` [PATCH 5/7] rc: fix _get_max_lfs_filesize on 32-bit platforms Darrick J. Wong
` (2 subsequent siblings)
6 siblings, 1 reply; 16+ messages in thread
From: Darrick J. Wong @ 2020-01-16 5:11 UTC (permalink / raw)
To: guaneryu, darrick.wong; +Cc: linux-xfs, fstests
From: Darrick J. Wong <darrick.wong@oracle.com>
Due to the unique structure of xfs/279 running _get_scsi_debug_dev from
a backtick from inside subshell, the "could not get scsi_debug device"
checks do not actually stop the test when modprobe scsi_debug fails.
Therefore, check the value of SCSI_DEBUG_DEV from the subshell and
_notrun the test if we couldn't get memory.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
tests/xfs/279 | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tests/xfs/279 b/tests/xfs/279
index 7ab8bdd5..0ddc6a00 100755
--- a/tests/xfs/279
+++ b/tests/xfs/279
@@ -65,6 +65,7 @@ _check_mkfs()
echo "==================="
echo "4k physical 512b logical aligned"
SCSI_DEBUG_DEV=`_get_scsi_debug_dev 4096 512 0 128`
+test -b "$SCSI_DEBUG_DEV" || _notrun "Could not get scsi_debug device"
# sector size should default to 4k
_check_mkfs $SCSI_DEBUG_DEV
# blocksize smaller than physical sectorsize should revert to logical sectorsize
@@ -77,6 +78,7 @@ _put_scsi_debug_dev
echo "==================="
echo "4k physical 512b logical unaligned"
SCSI_DEBUG_DEV=`_get_scsi_debug_dev 4096 512 1 128`
+test -b "$SCSI_DEBUG_DEV" || _notrun "Could not get scsi_debug device"
# should fail on misalignment
_check_mkfs $SCSI_DEBUG_DEV
# should fall back to logical sector size with force
@@ -93,6 +95,7 @@ _put_scsi_debug_dev
echo "==================="
echo "hard 4k physical / 4k logical"
SCSI_DEBUG_DEV=`_get_scsi_debug_dev 4096 4096 0 128`
+test -b "$SCSI_DEBUG_DEV" || _notrun "Could not get scsi_debug device"
# block size smaller than sector size should fail
_check_mkfs -b size=2048 $SCSI_DEBUG_DEV
# sector size smaller than physical sector size should fail
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH 4/7] xfs/279: skip test if we can't allocate scsi_debug device
2020-01-16 5:11 ` [PATCH 4/7] xfs/279: skip test if we can't allocate scsi_debug device Darrick J. Wong
@ 2020-01-16 9:24 ` Christoph Hellwig
0 siblings, 0 replies; 16+ messages in thread
From: Christoph Hellwig @ 2020-01-16 9:24 UTC (permalink / raw)
To: Darrick J. Wong; +Cc: guaneryu, linux-xfs, fstests
On Wed, Jan 15, 2020 at 09:11:00PM -0800, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> Due to the unique structure of xfs/279 running _get_scsi_debug_dev from
> a backtick from inside subshell, the "could not get scsi_debug device"
> checks do not actually stop the test when modprobe scsi_debug fails.
>
> Therefore, check the value of SCSI_DEBUG_DEV from the subshell and
> _notrun the test if we couldn't get memory.
Looks good,
Reviewed-by: Christoph Hellwig <hch@lst.de>
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 5/7] rc: fix _get_max_lfs_filesize on 32-bit platforms
2020-01-16 5:10 [PATCH 0/7] fstests: random fixes Darrick J. Wong
` (3 preceding siblings ...)
2020-01-16 5:11 ` [PATCH 4/7] xfs/279: skip test if we can't allocate scsi_debug device Darrick J. Wong
@ 2020-01-16 5:11 ` Darrick J. Wong
2020-01-16 9:25 ` Christoph Hellwig
2020-01-16 5:11 ` [PATCH 6/7] generic/108: skip test if we can't initialize scsi_debug Darrick J. Wong
2020-01-16 5:11 ` [PATCH 7/7] xfs/020: call _notrun if we can't create a 60t sparse image Darrick J. Wong
6 siblings, 1 reply; 16+ messages in thread
From: Darrick J. Wong @ 2020-01-16 5:11 UTC (permalink / raw)
To: guaneryu, darrick.wong; +Cc: linux-xfs, fstests
From: Darrick J. Wong <darrick.wong@oracle.com>
The 32-bit calculation of the maximum filesize is incorrect. Replace it
with the formula that the kernel has used since commit 0cc3b0ec23ce
("Clarify (and fix) MAX_LFS_FILESIZE macros"). This fixes a regression
in generic/351 on 32-bit kernels.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
common/rc | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/common/rc b/common/rc
index eeac1355..cf6bc9d5 100644
--- a/common/rc
+++ b/common/rc
@@ -3999,7 +3999,9 @@ _get_max_lfs_filesize()
{
case "$(getconf LONG_BIT)" in
"32")
- echo $(( ($(getconf PAGE_SIZE) << ($(getconf LONG_BIT) - 1) ) - 1))
+ local ulong_max=$(getconf ULONG_MAX)
+ local page_size=$(getconf PAGE_SIZE)
+ echo $(( ulong_max * page_size ))
;;
"64")
echo 9223372036854775807
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH 5/7] rc: fix _get_max_lfs_filesize on 32-bit platforms
2020-01-16 5:11 ` [PATCH 5/7] rc: fix _get_max_lfs_filesize on 32-bit platforms Darrick J. Wong
@ 2020-01-16 9:25 ` Christoph Hellwig
0 siblings, 0 replies; 16+ messages in thread
From: Christoph Hellwig @ 2020-01-16 9:25 UTC (permalink / raw)
To: Darrick J. Wong; +Cc: guaneryu, linux-xfs, fstests
On Wed, Jan 15, 2020 at 09:11:07PM -0800, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> The 32-bit calculation of the maximum filesize is incorrect. Replace it
> with the formula that the kernel has used since commit 0cc3b0ec23ce
> ("Clarify (and fix) MAX_LFS_FILESIZE macros"). This fixes a regression
> in generic/351 on 32-bit kernels.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Looks good,
Reviewed-by: Christoph Hellwig <hch@lst.de>
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 6/7] generic/108: skip test if we can't initialize scsi_debug
2020-01-16 5:10 [PATCH 0/7] fstests: random fixes Darrick J. Wong
` (4 preceding siblings ...)
2020-01-16 5:11 ` [PATCH 5/7] rc: fix _get_max_lfs_filesize on 32-bit platforms Darrick J. Wong
@ 2020-01-16 5:11 ` Darrick J. Wong
2020-01-16 9:25 ` Christoph Hellwig
2020-01-16 5:11 ` [PATCH 7/7] xfs/020: call _notrun if we can't create a 60t sparse image Darrick J. Wong
6 siblings, 1 reply; 16+ messages in thread
From: Darrick J. Wong @ 2020-01-16 5:11 UTC (permalink / raw)
To: guaneryu, darrick.wong; +Cc: linux-xfs, fstests
From: Darrick J. Wong <darrick.wong@oracle.com>
Correct the logic in this test that detects failed scsi_debug
initializations. Downgrade the reaction to _notrun since the filesystem
under test did not fail, just our mockup disk.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
tests/generic/108 | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/tests/generic/108 b/tests/generic/108
index 9b4fe60f..ab6101f2 100755
--- a/tests/generic/108
+++ b/tests/generic/108
@@ -49,9 +49,7 @@ rm -f $seqres.full
# _get_scsi_debug_dev returns a scsi debug device with 128M in size by default
SCSI_DEBUG_DEV=`_get_scsi_debug_dev 512 512 0 300`
-if [ "$SCSI_DEBUG_DEV" == "/dev/" ]; then
- _fail "Failed to initialize scsi debug device"
-fi
+test -b "$SCSI_DEBUG_DEV" || _notrun "Failed to initialize scsi debug device"
echo "SCSI debug device $SCSI_DEBUG_DEV" >>$seqres.full
# create striped volume with 4MB stripe size
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 7/7] xfs/020: call _notrun if we can't create a 60t sparse image
2020-01-16 5:10 [PATCH 0/7] fstests: random fixes Darrick J. Wong
` (5 preceding siblings ...)
2020-01-16 5:11 ` [PATCH 6/7] generic/108: skip test if we can't initialize scsi_debug Darrick J. Wong
@ 2020-01-16 5:11 ` Darrick J. Wong
2020-01-16 9:25 ` Christoph Hellwig
2020-02-02 19:54 ` Darrick J. Wong
6 siblings, 2 replies; 16+ messages in thread
From: Darrick J. Wong @ 2020-01-16 5:11 UTC (permalink / raw)
To: guaneryu, darrick.wong; +Cc: linux-xfs, fstests
From: Darrick J. Wong <darrick.wong@oracle.com>
If we can't create the 60T sparse image for testing repair on a large fs
(such as when running on 32-bit), don't bother running the rest of the
test.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
tests/xfs/020 | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tests/xfs/020 b/tests/xfs/020
index 61da4101..e39c3482 100755
--- a/tests/xfs/020
+++ b/tests/xfs/020
@@ -42,6 +42,8 @@ echo "Silence is golden"
fsfile=$TEST_DIR/fsfile.$seq
rm -f $fsfile
+truncate -s 60t $fsfile || _notrun "Cannot create 60T sparse file for test."
+rm -f $fsfile
$MKFS_PROG -t xfs -d size=60t,file,name=$fsfile >/dev/null
$XFS_REPAIR_PROG -f -o ag_stride=32 -t 1 $fsfile >/dev/null 2>&1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH 7/7] xfs/020: call _notrun if we can't create a 60t sparse image
2020-01-16 5:11 ` [PATCH 7/7] xfs/020: call _notrun if we can't create a 60t sparse image Darrick J. Wong
@ 2020-01-16 9:25 ` Christoph Hellwig
2020-02-02 19:54 ` Darrick J. Wong
1 sibling, 0 replies; 16+ messages in thread
From: Christoph Hellwig @ 2020-01-16 9:25 UTC (permalink / raw)
To: Darrick J. Wong; +Cc: guaneryu, linux-xfs, fstests
On Wed, Jan 15, 2020 at 09:11:19PM -0800, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> If we can't create the 60T sparse image for testing repair on a large fs
> (such as when running on 32-bit), don't bother running the rest of the
> test.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Looks good,
Reviewed-by: Christoph Hellwig <hch@lst.de>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 7/7] xfs/020: call _notrun if we can't create a 60t sparse image
2020-01-16 5:11 ` [PATCH 7/7] xfs/020: call _notrun if we can't create a 60t sparse image Darrick J. Wong
2020-01-16 9:25 ` Christoph Hellwig
@ 2020-02-02 19:54 ` Darrick J. Wong
1 sibling, 0 replies; 16+ messages in thread
From: Darrick J. Wong @ 2020-02-02 19:54 UTC (permalink / raw)
To: guaneryu; +Cc: linux-xfs, fstests
On Wed, Jan 15, 2020 at 09:11:19PM -0800, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> If we can't create the 60T sparse image for testing repair on a large fs
> (such as when running on 32-bit), don't bother running the rest of the
> test.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
> tests/xfs/020 | 2 ++
> 1 file changed, 2 insertions(+)
>
>
> diff --git a/tests/xfs/020 b/tests/xfs/020
> index 61da4101..e39c3482 100755
> --- a/tests/xfs/020
> +++ b/tests/xfs/020
> @@ -42,6 +42,8 @@ echo "Silence is golden"
>
> fsfile=$TEST_DIR/fsfile.$seq
> rm -f $fsfile
> +truncate -s 60t $fsfile || _notrun "Cannot create 60T sparse file for test."
Um, this got committed with "xfs_io -x -c 'truncate 60t' and not as
written, which means that this test does not work on i386 because xfs_io
doesn't return nonzero when the truncate syscall fails. Will send
patch.
--D
> +rm -f $fsfile
>
> $MKFS_PROG -t xfs -d size=60t,file,name=$fsfile >/dev/null
> $XFS_REPAIR_PROG -f -o ag_stride=32 -t 1 $fsfile >/dev/null 2>&1
>
^ permalink raw reply [flat|nested] 16+ messages in thread