All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] common/xfs: Fix _require_scratch_xfs_shrink bug
@ 2021-05-28  9:41 Yang Xu
  2021-05-28 11:58 ` Gao Xiang
  0 siblings, 1 reply; 2+ messages in thread
From: Yang Xu @ 2021-05-28  9:41 UTC (permalink / raw)
  To: fstests; +Cc: Yang Xu

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>
---
 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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] common/xfs: Fix _require_scratch_xfs_shrink bug
  2021-05-28  9:41 [PATCH] common/xfs: Fix _require_scratch_xfs_shrink bug Yang Xu
@ 2021-05-28 11:58 ` Gao Xiang
  0 siblings, 0 replies; 2+ messages in thread
From: Gao Xiang @ 2021-05-28 11:58 UTC (permalink / raw)
  To: Yang Xu; +Cc: fstests

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
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-05-28 11:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-28  9:41 [PATCH] common/xfs: Fix _require_scratch_xfs_shrink bug Yang Xu
2021-05-28 11:58 ` Gao Xiang

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.