diff mbox series

[1/2] xfs/614: query correct direct I/O alignment

Message ID 20250204134707.2018526-1-hch@lst.de (mailing list archive)
State New
Headers show
Series [1/2] xfs/614: query correct direct I/O alignment | expand

Commit Message

Christoph Hellwig Feb. 4, 2025, 1:46 p.m. UTC
When creating XFS file systems on files, mkfs will query the file system
for the minimum alignment, which can be larger than that of the
underlying device.  Do the same to link the right output file.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 tests/xfs/614 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Darrick J. Wong Feb. 4, 2025, 5:12 p.m. UTC | #1
On Tue, Feb 04, 2025 at 02:46:54PM +0100, Christoph Hellwig wrote:
> When creating XFS file systems on files, mkfs will query the file system
> for the minimum alignment, which can be larger than that of the
> underlying device.  Do the same to link the right output file.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>  tests/xfs/614 | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/xfs/614 b/tests/xfs/614
> index 0f8952e50b9a..06cc2384f38c 100755
> --- a/tests/xfs/614
> +++ b/tests/xfs/614
> @@ -26,7 +26,7 @@ _require_loop
>  $MKFS_XFS_PROG 2>&1 | grep -q concurrency || \
>  	_notrun "mkfs does not support concurrency options"
>  
> -test_dev_lbasize=$(blockdev --getss $TEST_DEV)
> +test_dev_lbasize=$($here/src/min_dio_alignment $TEST_DIR $TEST_DEV)

Hmmmm... I have a patch with a similar aim in my dev tree that
determines the lba size from whatever mkfs decides is the sector size:

# Figure out what sector size mkfs will use to format, which might be dependent
# upon the directio write geometry of the test filesystem.
loop_file=$TEST_DIR/$seq.loop
rm -f "$loop_file"
truncate -s 16M "$loop_file"
$MKFS_XFS_PROG -f -N "$loop_file" | _filter_mkfs 2>$tmp.mkfs >/dev/null
. $tmp.mkfs
seqfull=$0
_link_out_file "lba${sectsz}"

What do you think of that approach?

--D

>  seqfull=$0
>  _link_out_file "lba${test_dev_lbasize}"
>  
> -- 
> 2.45.2
> 
>
diff mbox series

Patch

diff --git a/tests/xfs/614 b/tests/xfs/614
index 0f8952e50b9a..06cc2384f38c 100755
--- a/tests/xfs/614
+++ b/tests/xfs/614
@@ -26,7 +26,7 @@  _require_loop
 $MKFS_XFS_PROG 2>&1 | grep -q concurrency || \
 	_notrun "mkfs does not support concurrency options"
 
-test_dev_lbasize=$(blockdev --getss $TEST_DEV)
+test_dev_lbasize=$($here/src/min_dio_alignment $TEST_DIR $TEST_DEV)
 seqfull=$0
 _link_out_file "lba${test_dev_lbasize}"