All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gao Xiang <hsiangkao@linux.alibaba.com>
To: Yang Xu <xuyang2018.jy@fujitsu.com>
Cc: fstests@vger.kernel.org
Subject: Re: [PATCH] common/xfs: Fix _require_scratch_xfs_shrink bug
Date: Fri, 28 May 2021 19:58:16 +0800	[thread overview]
Message-ID: <YLDa2Hc/1jlmi02P@bogon> (raw)
In-Reply-To: <1622194870-2085-1-git-send-email-xuyang2018.jy@fujitsu.com>

On Fri, May 28, 2021 at 05:41:10PM +0800, Yang Xu wrote:
> Since local declaration can't pass function return value, this
> helper never detects whether kernel or xfsprogs supports
> xfs shrink feature successfully. Fit it by separating declaration
> and assignment of local variables.
> 
> Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>

Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com>

(It seems a post-modified occasional issue since I didn't
 use a local variable here in the original patchset...)

Thanks,
Gao Xiang

> ---
>  common/xfs | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/common/xfs b/common/xfs
> index d7f2a005..c5e39427 100644
> --- a/common/xfs
> +++ b/common/xfs
> @@ -820,7 +820,8 @@ _require_scratch_xfs_shrink()
>  	. $tmp.mkfs
>  	_scratch_mount
>  	# here just to check if kernel supports, no need do more extra work
> -	local errmsg=$($XFS_GROWFS_PROG -D$((dblocks-1)) "$SCRATCH_MNT" 2>&1)
> +	local errmsg
> +	errmsg=$($XFS_GROWFS_PROG -D$((dblocks-1)) "$SCRATCH_MNT" 2>&1)
>  	if [ "$?" -ne 0 ]; then
>  		echo "$errmsg" | grep 'XFS_IOC_FSGROWFSDATA xfsctl failed: Invalid argument' > /dev/null && \
>  			_notrun "kernel does not support shrinking"
> -- 
> 2.27.0
> 

      reply	other threads:[~2021-05-28 11:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-28  9:41 [PATCH] common/xfs: Fix _require_scratch_xfs_shrink bug Yang Xu
2021-05-28 11:58 ` Gao Xiang [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=YLDa2Hc/1jlmi02P@bogon \
    --to=hsiangkao@linux.alibaba.com \
    --cc=fstests@vger.kernel.org \
    --cc=xuyang2018.jy@fujitsu.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.