All of lore.kernel.org
 help / color / mirror / Atom feed
From: Carlos Maiolino <cmaiolino@redhat.com>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: sandeen@redhat.com, linux-xfs@vger.kernel.org
Subject: Re: [PATCH 5/7] fsck: fix more bashisms
Date: Mon, 28 May 2018 16:02:39 +0200	[thread overview]
Message-ID: <20180528140239.fg632s7bj3yksepx@odin.usersys.redhat.com> (raw)
In-Reply-To: <152728632778.22515.10077636373761717143.stgit@magnolia>

On Fri, May 25, 2018 at 03:12:07PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> command -v is a bashism, so we need to get rid of it.  The shell returns
> an error code of 127 if it couldn't invoke xfs_repair, so teach
> repair2fsck_code to deal with this.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>

> ---
>  fsck/xfs_fsck.sh |   12 +++++-------
>  1 file changed, 5 insertions(+), 7 deletions(-)
> 
> 
> diff --git a/fsck/xfs_fsck.sh b/fsck/xfs_fsck.sh
> index 1916c07e..6af0f224 100755
> --- a/fsck/xfs_fsck.sh
> +++ b/fsck/xfs_fsck.sh
> @@ -20,6 +20,10 @@ repair2fsck_code() {
>  		;;
>  	4)  return 1 # The fs has been fixed
>  		;;
> +	127)
> +		echo "$NAME error: xfs_repair was not found!" 1>&2
> +		return 4
> +		;;
>  	*)  echo "$NAME error: An unknown return code from xfs_repair '$1'" 1>&2
>  		return 4 # something went wrong with xfs_repair
>  	esac
> @@ -59,13 +63,7 @@ if [ -n "$PS1" -o -t 0 ]; then
>  fi
>  
>  if $FORCE; then
> -	XFS_REPAIR=`command -v xfs_repair`
> -	if [ ! -x "$XFS_REPAIR" ] ; then
> -		echo "$NAME error: xfs_repair was not found!" 1>&2
> -		exit 4
> -	fi
> -
> -	$XFS_REPAIR -e $DEV
> +	xfs_repair -e $DEV
>  	repair2fsck_code $?
>  	exit $?
>  fi
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Carlos

  parent reply	other threads:[~2018-05-28 14:02 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-25 22:11 [PATCH 0/7] xfsprogs-4.17: last of the fixes Darrick J. Wong
2018-05-25 22:11 ` [PATCH 1/7] xfs_repair: fix integer handling issues Darrick J. Wong
2018-05-28  3:52   ` Allison Henderson
2018-05-28 13:56   ` Carlos Maiolino
2018-05-29 14:52     ` Darrick J. Wong
2018-05-29 15:15   ` [PATCH v2 " Darrick J. Wong
2018-05-25 22:11 ` [PATCH 2/7] xfs_buflock: ignore if buffer already locked Darrick J. Wong
2018-05-28  3:52   ` Allison Henderson
2018-05-25 22:11 ` [PATCH 3/7] xfs_buflock: record line number of trace where we locked the buffer Darrick J. Wong
2018-05-28  3:52   ` Allison Henderson
2018-05-25 22:12 ` [PATCH 4/7] xfs_buflock: record buffer initialization Darrick J. Wong
2018-05-28  3:52   ` Allison Henderson
2018-05-25 22:12 ` [PATCH 5/7] fsck: fix more bashisms Darrick J. Wong
2018-05-28  3:52   ` Allison Henderson
2018-05-28 14:02   ` Carlos Maiolino [this message]
2018-05-25 22:12 ` [PATCH 6/7] xfs_scrub: actually check for errors coming from close() Darrick J. Wong
2018-05-28  3:52   ` Allison Henderson
2018-05-28 14:06   ` Carlos Maiolino
2018-05-25 22:12 ` [PATCH 7/7] libxfs: remove crc32 functions Darrick J. Wong
2018-05-28  3:53   ` Allison Henderson
2018-05-28 14:11     ` Carlos Maiolino
2018-05-29 14:56       ` Darrick J. Wong
2018-05-29 21:46         ` Eric Sandeen
2018-07-23 22:55   ` Eric Sandeen
2018-07-24 19:48     ` Darrick J. Wong
2018-05-29 19:10 ` [PATCH 0/7] xfsprogs-4.17: last of the fixes Eric Sandeen

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=20180528140239.fg632s7bj3yksepx@odin.usersys.redhat.com \
    --to=cmaiolino@redhat.com \
    --cc=darrick.wong@oracle.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sandeen@redhat.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.