xfs: add regression test for small zone capacity
cover xfs: add regression test for small zone capacity
From: Carlos Maiolino <[email protected]>
This adds a regression test for the smaller sequential zone capacities problem.
For that, we need to be able to create a zoned loop device with a custom capacity, so the first patch extents _create_zloop to accept a custom zone capacity.
Carlos Maiolino (2):
common/zoned: enable passing a custom capacity
xfs: Add test for mkfs with smaller zone capacity
common/zoned | 8 ++++++-- tests/xfs/333 | 37 +++++++++++++++++++++++++++++++++++++ tests/xfs/333.out | 2 ++ 3 files changed, 45 insertions(+), 2 deletions(-) create mode 100755 tests/xfs/333 create mode 100644 tests/xfs/333.out
Signature · 1 line
2.51.1
PATCH 1/2 common/zoned: enable passing a custom capacity
From: Carlos Maiolino <[email protected]>
Extend _create_zloop() to accept a custom zone capacity.
--- common/zoned | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
common/zoned +6 -2
@@ -61,7 +61,7 @@ _find_next_zloop() } # Create a zloop device -# usage: _create_zloop <base_dir> <zone_size> <nr_conv_zones> +# usage: _create_zloop <base_dir> <zone_size> <nr_conv_zones> <zone_capacity> _create_zloop() { local id="$(_find_next_zloop)"
@@ -80,9 +80,13 @@ _create_zloop() local conv_zones=",conv_zones=$3" fi + if [ -n "$4" ]; then + local zone_capacity=",zone_capacity_mb=$4" + fi + mkdir -p "$zloop_base/$id" - local zloop_args="add id=$id,base_dir=$zloop_base$zone_size$conv_zones" + local zloop_args="add id=$id,base_dir=$zloop_base$zone_size$conv_zones$zone_capacity" echo "$zloop_args" > /dev/zloop-control || \ _fail "cannot create zloop device"
Signature · 1 line
2.51.1
Re: [PATCH 1/2] common/zoned: enable passing a custom capacity
Looks good,
Re: [PATCH 1/2] common/zoned: enable passing a custom capacity
In reply to [email protected]Looks good:
Re: [PATCH 1/2] common/zoned: enable passing a custom capacity
In reply to [email protected]Quoted 14 lines · On Thu, Nov 20, 2025 at 05:08:29PM +0100, [email protected] wrote:
From: Carlos Maiolino <[email protected]>
Extend
_create_zloop()to accept a custom zone capacity.Signed-off-by Carlos Maiolino <[email protected]>--- common/zoned | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)common/zoned +0
-0
common/zoned _find_next_zloop() · line 64
Quoted 5 lines
common/zoned +1
-1@@ -61,7 +61,7 @@ _find_next_zloop() } # Create a zloop device -# usage: _create_zloop <base_dir> <zone_size> <nr_conv_zones> +# usage: _create_zloop <base_dir> <zone_size> <nr_conv_zones> <zone_capacity>
Actually from the logic of _create_zloop, these 4 arguments are optional, not necessary, so the "<...>" should be "[...]"
Quoted 5 lines
common/zoned +0
-0_create_zloop() { local id="$(_find_next_zloop)"@@ -80,9 +80,13 @@ _create_zloop() local conv_zones=",conv_zones=$3"
common/zoned _create_zloop() · line 89
Quoted 10 lines
common/zoned +5
-1fi + if [ -n "$4" ]; then + local zone_capacity=",zone_capacity_mb=$4" + fi + mkdir -p "$zloop_base/$id" - local zloop_args="add id=$id,base_dir=$zloop_base$zone_size$conv_zones" + local zloop_args="add id=$id,base_dir=$zloop_base$zone_size$conv_zones$zone_capacity"
If the "zone_capacity" isn't a new feature which need a _require_ helper to check it's supported, then this patch looks good to me.
Quoted 6 lines
common/zoned +0
-0echo "$zloop_args" > /dev/zloop-control || \ _fail "cannot create zloop device"Signature · 1 line
2.51.1
PATCH 2/2 xfs: Add test for mkfs with smaller zone capacity
In reply to [email protected]From: Carlos Maiolino <[email protected]>
Add a regression test for initializing zoned block devices with sequential zones with a capacity smaller than the conventional zones capacity.
--- tests/xfs/333 | 37 +++++++++++++++++++++++++++++++++++++ tests/xfs/333.out | 2 ++ 2 files changed, 39 insertions(+) create mode 100755 tests/xfs/333 create mode 100644 tests/xfs/333.out
tests/xfs/333 new file +37 -0
@@ -0,0 +1,37 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2025 Red Hat, Inc. All Rights Reserved. +# +# FS QA Test 333 +# +# Test that mkfs can properly initialize zoned devices +# with a sequential zone capacity smaller than the conventional zone. +# +. ./common/preamble +. ./common/zoned + +_begin_fstest auto zone mkfs quick +_cleanup() +{ + _destroy_zloop $zloop +} + +_require_scratch +_require_zloop + +_scratch_mkfs > /dev/null 2>&1 +_scratch_mount >> $seqres.full + +zloopdir="$SCRATCH_MNT/zloop" +zone_size=64 +conv_zones=2 +zone_capacity=63 + +zloop=$(_create_zloop $zloopdir $zone_size $conv_zones $zone_capacity) + +_try_mkfs_dev $zloop >> $seqres.full 2>&1 || \ + _fail "Cannot mkfs zoned filesystem" + +echo Silence is golden +# success, all done +_exit 0
tests/xfs/333.out new file +2 -0
@@ -0,0 +1,2 @@ +QA output created by 333 +Silence is golden
Signature · 1 line
2.51.1
Re: [PATCH 2/2] xfs: Add test for mkfs with smaller zone capacity
Looks good:
Re: [PATCH 2/2] xfs: Add test for mkfs with smaller zone capacity
In reply to [email protected]Quoted 5 lines · On 11/20/25 5:09 PM, [email protected] wrote:
From: Carlos Maiolino <[email protected]>
Add a regression test for initializing zoned block devices with sequential zones with a capacity smaller than the conventional zones capacity.
Hi Carlos,
Two quick questions:
1) Is there a specific reason this is a xfs only test? I think checking this on btrfs and f2fs would make sense as well, like with generic/781.
2) I would also mount the FS and perform some IO on it.
Quoted 59 lines
Signed-off-by Carlos Maiolino <[email protected]>--- tests/xfs/333 | 37 +++++++++++++++++++++++++++++++++++++ tests/xfs/333.out | 2 ++ 2 files changed, 39 insertions(+)create mode 100755 tests/xfs/333
create mode 100644 tests/xfs/333.outtests/xfs/333 new file +37
-0@@ -0,0 +1,37 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2025 Red Hat, Inc. All Rights Reserved. +# +# FS QA Test 333 +# +# Test that mkfs can properly initialize zoned devices +# with a sequential zone capacity smaller than the conventional zone. +# +. ./common/preamble +. ./common/zoned + +_begin_fstest auto zone mkfs quick +_cleanup() +{ + _destroy_zloop $zloop +} + +_require_scratch +_require_zloop + +_scratch_mkfs > /dev/null 2>&1 +_scratch_mount >> $seqres.full + +zloopdir="$SCRATCH_MNT/zloop" +zone_size=64 +conv_zones=2 +zone_capacity=63 + +zloop=$(_create_zloop $zloopdir $zone_size $conv_zones $zone_capacity) + +_try_mkfs_dev $zloop >> $seqres.full 2>&1 || \ + _fail "Cannot mkfs zoned filesystem" + +echo Silence is golden +# success, all done +_exit 0tests/xfs/333.out new file +2
-0@@ -0,0 +1,2 @@ +QA output created by 333 +Silence is golden
Re: [PATCH 2/2] xfs: Add test for mkfs with smaller zone capacity
Quoted 8 lines · Johannes Thumshirn
Quoted 5 lines · On 11/20/25 5:09 PM, [email protected] wrote:
From: Carlos Maiolino <[email protected]>
Add a regression test for initializing zoned block devices with sequential zones with a capacity smaller than the conventional zones capacity.
Quoted 6 lines
Hi Carlos,
Two quick questions:
1) Is there a specific reason this is a xfs only test? I think checking this on btrfs and f2fs would make sense as well, like with generic/781.
Didn't f2fs drop zone_capacity < zone_size support because they only care about their android out of tree use case?
But otherwise I'd agree.
Re: [PATCH 2/2] xfs: Add test for mkfs with smaller zone capacity
Quoted 10 lines · hch
Quoted 9 lines · Johannes Thumshirn
Quoted 5 lines · On 11/20/25 5:09 PM, [email protected] wrote:
From: Carlos Maiolino <[email protected]>
Add a regression test for initializing zoned block devices with sequential zones with a capacity smaller than the conventional zones capacity.
Hi Carlos,
Quoted 9 lines
Quoted 4 lines
Two quick questions:
1) Is there a specific reason this is a xfs only test? I think checking this on btrfs and f2fs would make sense as well, like with generic/781.
Didn't f2fs drop
zone_capacity<zone_sizesupport because they only care about their android out of tree use case?But otherwise I'd agree.
That one I actually don't know
Re: [PATCH 2/2] xfs: Add test for mkfs with smaller zone capacity
Quoted 13 lines · Johannes Thumshirn
Quoted 12 lines · hch
Quoted 11 lines · Johannes Thumshirn
Quoted 5 lines · On 11/20/25 5:09 PM, [email protected] wrote:
From: Carlos Maiolino <[email protected]>
Add a regression test for initializing zoned block devices with sequential zones with a capacity smaller than the conventional zones capacity.
Hi Carlos,
Two quick questions:
Quoted 10 lines
Quoted 7 lines
Quoted 2 lines
1) Is there a specific reason this is a xfs only test? I think checking this on btrfs and f2fs would make sense as well, like with generic/781.
Didn't f2fs drop
zone_capacity<zone_sizesupport because they only care about their android out of tree use case?But otherwise I'd agree.
That one I actually don't know
+ Bart
I've been benchmarking f2fs with zone capacity < zone size lately on SSD devices, so i'd be surprised if that has stopped working (but that requires a separate blockdev for metadata (e.g. a separate name space)
Single-zoned-device f2fs file systems also works:
mkfs.f2fs -m /dev/<host managed smr disk>
(but that has zone_size==cone_capacity)
..so i think this should be applicable for f2fs as well
Re: [PATCH 2/2] xfs: Add test for mkfs with smaller zone capacity
In reply to Johannes ThumshirnQuoted 8 lines · Johannes Thumshirn
Quoted 5 lines · On 11/20/25 5:09 PM, [email protected] wrote:
From: Carlos Maiolino <[email protected]>
Add a regression test for initializing zoned block devices with sequential zones with a capacity smaller than the conventional zones capacity.
Quoted 6 lines
Hi Carlos,
Two quick questions:
1) Is there a specific reason this is a xfs only test? I think checking this on btrfs and f2fs would make sense as well, like with generic/781.
I wrote this mostly as a regression test for xfs's mkfs, but yeah, I don't think there is any reason for this to be xfs-specific.
Quoted 2 lines
2) I would also mount the FS and perform some IO on it.
I'm not sure about this. Do you have any purpose in mind? This is specifically to test mkfs is able to properly format the filesystem, not to try the kernel module per-se.
One could argue that something 'could' go wrong in the mkfs that might be found out only via some IO, but that would require much more than just 'some IO'.
I do think a mount/unmount might add some value to the test, but I fail to see why issuing a random amount of I/O would prove the correctness of mkfs properly dealing with small capacities.
Cheers.
Carlos
Quoted 64 lines
Quoted 62 lines
Signed-off-by Carlos Maiolino <[email protected]>--- tests/xfs/333 | 37 +++++++++++++++++++++++++++++++++++++ tests/xfs/333.out | 2 ++ 2 files changed, 39 insertions(+)create mode 100755 tests/xfs/333
create mode 100644 tests/xfs/333.outtests/xfs/333 new file +37
-0@@ -0,0 +1,37 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2025 Red Hat, Inc. All Rights Reserved. +# +# FS QA Test 333 +# +# Test that mkfs can properly initialize zoned devices +# with a sequential zone capacity smaller than the conventional zone. +# +. ./common/preamble +. ./common/zoned + +_begin_fstest auto zone mkfs quick +_cleanup() +{ + _destroy_zloop $zloop +} + +_require_scratch +_require_zloop + +_scratch_mkfs > /dev/null 2>&1 +_scratch_mount >> $seqres.full + +zloopdir="$SCRATCH_MNT/zloop" +zone_size=64 +conv_zones=2 +zone_capacity=63 + +zloop=$(_create_zloop $zloopdir $zone_size $conv_zones $zone_capacity) + +_try_mkfs_dev $zloop >> $seqres.full 2>&1 || \ + _fail "Cannot mkfs zoned filesystem" + +echo Silence is golden +# success, all done +_exit 0tests/xfs/333.out new file +2
-0@@ -0,0 +1,2 @@ +QA output created by 333 +Silence is golden
Re: [PATCH 2/2] xfs: Add test for mkfs with smaller zone capacity
Quoted 17 lines · Carlos Maiolino
Quoted 7 lines · Johannes Thumshirn
Quoted 5 lines · On 11/20/25 5:09 PM, [email protected] wrote:
From: Carlos Maiolino <[email protected]>
Add a regression test for initializing zoned block devices with sequential zones with a capacity smaller than the conventional zones capacity.
Quoted 6 lines
Hi Carlos,
Two quick questions:
1) Is there a specific reason this is a xfs only test? I think checking this on btrfs and f2fs would make sense as well, like with generic/781.
I wrote this mostly as a regression test for xfs's mkfs, but yeah, I don't think there is any reason for this to be xfs-specific.
Quoted 7 lines
Quoted 1 line
2) I would also mount the FS and perform some IO on it.
I'm not sure about this. Do you have any purpose in mind? This is specifically to test mkfs is able to properly format the filesystem, not to try the kernel module per-se.
One could argue that something 'could' go wrong in the mkfs that might be found out only via some IO, but that would require much more than just 'some IO'.
Yep that's what I had in mind.
Quoted 3 lines
I do think a mount/unmount might add some value to the test, but I fail to see why issuing a random amount of I/O would prove the correctness of mkfs properly dealing with small capacities.
fstests does a fsck after each test, doesn't it? So that should be sufficient as well.
Re: [PATCH 2/2] xfs: Add test for mkfs with smaller zone capacity
Quoted 7 lines · Johannes Thumshirn
Quoted 3 lines
I do think a mount/unmount might add some value to the test, but I fail to see why issuing a random amount of I/O would prove the correctness of mkfs properly dealing with small capacities.
fstests does a fsck after each test, doesn't it? So that should be sufficient as well.
But only for well defined devices, not those made up from thin air. So we'd need to do that manually here.
Re: [PATCH 2/2] xfs: Add test for mkfs with smaller zone capacity
In reply to Johannes ThumshirnQuoted 30 lines · Johannes Thumshirn
Quoted 17 lines · Carlos Maiolino
Quoted 7 lines · Johannes Thumshirn
Quoted 5 lines · On 11/20/25 5:09 PM, [email protected] wrote:
From: Carlos Maiolino <[email protected]>
Add a regression test for initializing zoned block devices with sequential zones with a capacity smaller than the conventional zones capacity.
Quoted 6 lines
Hi Carlos,
Two quick questions:
1) Is there a specific reason this is a xfs only test? I think checking this on btrfs and f2fs would make sense as well, like with generic/781.
I wrote this mostly as a regression test for xfs's mkfs, but yeah, I don't think there is any reason for this to be xfs-specific.
Quoted 7 lines
Quoted 1 line
2) I would also mount the FS and perform some IO on it.
I'm not sure about this. Do you have any purpose in mind? This is specifically to test mkfs is able to properly format the filesystem, not to try the kernel module per-se.
One could argue that something 'could' go wrong in the mkfs that might be found out only via some IO, but that would require much more than just 'some IO'.Yep that's what I had in mind.
Quoted 8 lines
Quoted 3 lines
I do think a mount/unmount might add some value to the test, but I fail to see why issuing a random amount of I/O would prove the correctness of mkfs properly dealing with small capacities.
fstests does a fsck after each test, doesn't it? So that should be sufficient as well.
I particularly don't agree with mounting/unmounting the FS here, that extends the test to more than it is supposed to test, i.e. ensuring mkfs can initialize the filesystem.
Although I agree running fsck on it to certify nothing obviously wrong happened with mkfs.
I think I've got another bug though which I started to investigate a few minutes ago. Reason why I think we should split mkfs and mount/unmount testing into two different tests.
Anyway, I'll see what's going on an update this test appropriately for a new version.
Thanks for the reviews.
Re: [PATCH 2/2] xfs: Add test for mkfs with smaller zone capacity
In reply to [email protected]Quoted 26 lines · On Thu, Nov 20, 2025 at 05:08:30PM +0100, [email protected] wrote:
From: Carlos Maiolino <[email protected]>
Add a regression test for initializing zoned block devices with sequential zones with a capacity smaller than the conventional zones capacity.
Signed-off-by Carlos Maiolino <[email protected]>--- tests/xfs/333 | 37 +++++++++++++++++++++++++++++++++++++ tests/xfs/333.out | 2 ++ 2 files changed, 39 insertions(+) create mode 100755 tests/xfs/333 create mode 100644 tests/xfs/333.outtests/xfs/333 new file +6
-0@@ -0,0 +1,37 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2025 Red Hat, Inc. All Rights Reserved. +# +# FS QA Test 333 +#
tests/xfs/333 line 16
Quoted 10 lines
tests/xfs/333 new file +10
-0+# Test that mkfs can properly initialize zoned devices +# with a sequential zone capacity smaller than the conventional zone. +# +. ./common/preamble +. ./common/zoned + +_begin_fstest auto zone mkfs quick +_cleanup() +{ + _destroy_zloop $zloop
cd /
rm -r -f $tmp.*tests/xfs/333 line 19
Quoted 3 lines
tests/xfs/333 new file +3
-0+} + +_require_scratch
_require_block_device $SCRATCH_DEV
tests/xfs/333 line 20
Quoted 1 line
tests/xfs/333 new file +1
-0+_require_zloop
g/781 checks if current $FSTYP supports zoned filesystem, and _notrun if it's not supported:
_try_mkfs_dev $zloop >> $seqres.full 2>&1 ||\
_notrun "cannot mkfs zoned filesystem"
I'm wondering if we could have a common helper for that, then this case can be a generic test case too.
For example:
_require_zloop_filesystem()
{
_require_zloop
local zloopdir="$TEST_DIR/zloop_test"
local zloop=$(_create_zloop $zloopdir 64 2)
_try_mkfs_dev $zloop >/dev/null 2>&1 || \
_notrun "cannot make $FSTYP on zloop"
_destroy_zloop $zloop
}But this method takes too much time to run, does anyone have a better idea to help it to be finished in several seconds?
tests/xfs/333 line 28
Quoted 8 lines
tests/xfs/333 new file +8
-0+ +_scratch_mkfs > /dev/null 2>&1 +_scratch_mount >> $seqres.full + +zloopdir="$SCRATCH_MNT/zloop" +zone_size=64 +conv_zones=2 +zone_capacity=63
Better to add a comment to explain what are these numbers for.
tests/xfs/333 line 35
Quoted 7 lines
tests/xfs/333 new file +7
-0+ +zloop=$(_create_zloop $zloopdir $zone_size $conv_zones $zone_capacity) + +_try_mkfs_dev $zloop >> $seqres.full 2>&1 || \ + _fail "Cannot mkfs zoned filesystem" + +echo Silence is golden
Is this done? If such zloop device can be created, should we expect it works as usual?
Thanks,
Zorro
Quoted 13 lines
tests/xfs/333 new file +2
-0+# success, all done +_exit 0tests/xfs/333.out new file +2
-0@@ -0,0 +1,2 @@ +QA output created by 333 +Silence is goldenSignature · 1 line
2.51.1
Re: [PATCH 2/2] xfs: Add test for mkfs with smaller zone capacity
Quoted 41 lines · Zorro Lang
Quoted 26 lines · On Thu, Nov 20, 2025 at 05:08:30PM +0100, [email protected] wrote:
From: Carlos Maiolino <[email protected]>
Add a regression test for initializing zoned block devices with sequential zones with a capacity smaller than the conventional zones capacity.
Signed-off-by Carlos Maiolino <[email protected]>--- tests/xfs/333 | 37 +++++++++++++++++++++++++++++++++++++ tests/xfs/333.out | 2 ++ 2 files changed, 39 insertions(+) create mode 100755 tests/xfs/333 create mode 100644 tests/xfs/333.outtests/xfs/333 new file +6
-0@@ -0,0 +1,37 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2025 Red Hat, Inc. All Rights Reserved. +# +# FS QA Test 333 +#tests/xfs/333 line 16
Quoted 10 lines
tests/xfs/333 new file +10
-0+# Test that mkfs can properly initialize zoned devices +# with a sequential zone capacity smaller than the conventional zone. +# +. ./common/preamble +. ./common/zoned + +_begin_fstest auto zone mkfs quick +_cleanup() +{ + _destroy_zloop $zloopcd / rm -r -f $tmp.*
Quoted 5 lines
tests/xfs/333 line 19
Quoted 3 lines
tests/xfs/333 new file +3
-0+} + +_require_scratch
_require_block_device$SCRATCH_DEV
I'll add to the V2.
Quoted 30 lines
tests/xfs/333 line 20
Quoted 2 lines
tests/xfs/333 new file +1
-0+_require_zloopg/781 checks if current $FSTYP supports zoned filesystem, and
_notrunif it's not supported:
_try_mkfs_dev$zloop >> $seqres.full 2>&1 ||\
_notrun"cannot mkfs zoned filesystem"I'm wondering if we could have a common helper for that, then this case can be a generic test case too.
For example:
_require_zloop_filesystem(){ _require_zloop local zloopdir="$TEST_DIR/zloop_test" local zloop=$(_create_zloop $zloopdir 64 2) _try_mkfs_dev $zloop >/dev/null 2>&1 || \ _notrun "cannot make $FSTYP on zloop" _destroy_zloop $zloop }But this method takes too much time to run, does anyone have a better idea to help it to be finished in several seconds?
Quoted 10 lines
tests/xfs/333 line 28
Quoted 8 lines
tests/xfs/333 new file +8
-0+ +_scratch_mkfs > /dev/null 2>&1 +_scratch_mount >> $seqres.full + +zloopdir="$SCRATCH_MNT/zloop" +zone_size=64 +conv_zones=2 +zone_capacity=63Better to add a comment to explain what are these numbers for.
Hmm, why? The variable names are very self-descriptive. I could add a comment, but it's just redundant IMHO, ex:
zone_size=64 # Set zloop zone size to 64MiB
I added the variables instead of passing the numbers directly to _create_zloop to avoid needing to go back and forth to _create_zloop definition and make the meaning clear.
I'm fine adding the comments, I just don't see the point.
Quoted 10 lines
tests/xfs/333 line 35
Quoted 8 lines
tests/xfs/333 new file +7
-0+ +zloop=$(_create_zloop $zloopdir $zone_size $conv_zones $zone_capacity) + +_try_mkfs_dev $zloop >> $seqres.full 2>&1 || \ + _fail "Cannot mkfs zoned filesystem" + +echo Silence is goldenIs this done? If such zloop device can be created, should we expect it works as usual?
Yes, the whole point is to ensure mkfs can initialize the filesystem on top of the zoned block device.
Cheers,
Carlos
PATCH 1/1 common/rc: fix _xfs_is_realtime_file for internal rt devices
In reply to [email protected]From: Darrick J. Wong <[email protected]>
Now that we can have internal realtime devices, it's possible to have a realtime filesystem without setting USE_EXTERNAL=yes or SCRATCH_RTDEV. Use the existing _xfs_has_feature helper to figure out if the given path points to a filesystem with an online realtime volume.
--- common/xfs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
common/xfs +3 -3
@@ -253,9 +253,9 @@ _xfs_get_dir_blocksize() # Decide if this path is a file on the realtime device _xfs_is_realtime_file() { - if [ "$USE_EXTERNAL" != "yes" ] || [ -z "$SCRATCH_RTDEV" ]; then - return 1 - fi + local mntpt="$(findmnt --target "$1" --noheadings --output TARGET)" + + _xfs_has_feature $mntpt realtime || return 1 $XFS_IO_PROG -c 'stat -v' "$1" | grep -q -w realtime }
Re: [PATCH] common/rc: fix _xfs_is_realtime_file for internal rt devices
Quoted 6 lines · Darrick J. Wong
From: Darrick J. Wong <[email protected]>
Now that we can have internal realtime devices, it's possible to have a realtime filesystem without setting USE_EXTERNAL=yes or
SCRATCH_RTDEV. Use the existing_xfs_has_featurehelper to figure out if the given path points to a filesystem with an online realtime volume.
Oops, silly me must have hit reply-all by mistake.
--D
Quoted 23 lines
Signed-off-by "Darrick J. Wong" <[email protected]>--- common/xfs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)common/xfs +3
-3@@ -253,9 +253,9 @@ _xfs_get_dir_blocksize() # Decide if this path is a file on the realtime device _xfs_is_realtime_file() { - if [ "$USE_EXTERNAL" != "yes" ] || [ -z "$SCRATCH_RTDEV" ]; then - return 1 - fi + local mntpt="$(findmnt --target "$1" --noheadings --output TARGET)" + + _xfs_has_feature $mntpt realtime || return 1 $XFS_IO_PROG -c 'stat -v' "$1" | grep -q -w realtime }
Re: [PATCH] common/rc: fix _xfs_is_realtime_file for internal rt devices
In reply to Darrick J. WongQuoted 6 lines · Darrick J. Wong
From: Darrick J. Wong <[email protected]>
Now that we can have internal realtime devices, it's possible to have a realtime filesystem without setting USE_EXTERNAL=yes or
SCRATCH_RTDEV. Use the existing_xfs_has_featurehelper to figure out if the given path points to a filesystem with an online realtime volume.
Looks good:
although right now it should not matter - one user of _xfs_is_realtime_file requires reflinks and the other explicitly excludes zoned file systems.
Re: [PATCH] common/rc: fix _xfs_is_realtime_file for internal rt devices
Quoted 8 lines · Christoph Hellwig
Quoted 6 lines · Darrick J. Wong
From: Darrick J. Wong <[email protected]>
Now that we can have internal realtime devices, it's possible to have a realtime filesystem without setting USE_EXTERNAL=yes or
SCRATCH_RTDEV. Use the existing_xfs_has_featurehelper to figure out if the given path points to a filesystem with an online realtime volume.
Quoted 7 lines
Looks good:
Reviewed-by Christoph Hellwig <[email protected]>although right now it should not matter - one user of
_xfs_is_realtime_filerequires reflinks and the other explicitly excludes zoned file systems.
I know; I found this by observing that one of the new xfs_healer tests wasn't working quite right on internal-zoned xfs. There wouldn't be much point in citing xfs/1899 as the discovery point. :(
--D