Re: [PATCH] common/rc: fix _xfs_is_realtime_file for internal rt devices

Darrick J. Wong
2025-11-20T23:24:27Z

On Thu, Nov 20, 2025 at 03:15:36PM -0800, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
>
> 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.

Oops, silly me must have hit reply-all by mistake.

--D

> Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
> ---
> common/xfs | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/common/xfs b/common/xfs
> index ffdb82e6c970ba..8b1b87413659ad 100644
> --- a/common/xfs
> +++ b/common/xfs
> @@ -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
> }
>
>