public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: zlang@kernel.org, fstests@vger.kernel.org
Subject: Re: [PATCH] common: cleanup scratch_mkfs_sized
Date: Wed, 11 Dec 2024 09:44:41 -0800	[thread overview]
Message-ID: <20241211174441.GF6698@frogsfrogsfrogs> (raw)
In-Reply-To: <20241210065435.1234629-1-hch@lst.de>

On Tue, Dec 10, 2024 at 07:54:35AM +0100, Christoph Hellwig wrote:
> Move the XFS RT specific code into the file system type switch
> statement.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Looks good to me,
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>

--D

> ---
>  common/rc | 17 ++++++++++-------
>  1 file changed, 10 insertions(+), 7 deletions(-)
> 
> diff --git a/common/rc b/common/rc
> index 1b2e4508d767..906905daa92d 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -1152,7 +1152,6 @@ _try_scratch_mkfs_sized()
>  	shift
>  	local def_blksz
>  	local blocksize_opt
> -	local rt_ops
>  
>  	case $FSTYP in
>  	xfs)
> @@ -1202,14 +1201,18 @@ _try_scratch_mkfs_sized()
>  		[ "$fssize" -gt "$devsize" ] && _notrun "Scratch device too small"
>  	fi
>  
> -	if [ "$FSTYP" = "xfs" ] && [ -b "$SCRATCH_RTDEV" ]; then
> -		local rtdevsize=`blockdev --getsize64 $SCRATCH_RTDEV`
> -		[ "$fssize" -gt "$rtdevsize" ] && _notrun "Scratch rt device too small"
> -		rt_ops="-r size=$fssize"
> -	fi
> -
>  	case $FSTYP in
>  	xfs)
> +		local rt_ops
> +
> +		if [ -b "$SCRATCH_RTDEV" ]; then
> +			local rtdevsize=`blockdev --getsize64 $SCRATCH_RTDEV`
> +			if [ "$fssize" -gt "$rtdevsize" ]; then
> +				_notrun "Scratch rt device too small"
> +			fi
> +			rt_ops="-r size=$fssize"
> +		fi
> +
>  		# don't override MKFS_OPTIONS that set a block size.
>  		echo $MKFS_OPTIONS |grep -E -q "b\s*size="
>  		if [ $? -eq 0 ]; then
> -- 
> 2.45.2
> 

      reply	other threads:[~2024-12-11 17:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-10  6:54 [PATCH] common: cleanup scratch_mkfs_sized Christoph Hellwig
2024-12-11 17:44 ` Darrick J. Wong [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241211174441.GF6698@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=fstests@vger.kernel.org \
    --cc=hch@lst.de \
    --cc=zlang@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox