linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Allison Henderson <allison.henderson@oracle.com>
To: "Darrick J. Wong" <darrick.wong@oracle.com>, sandeen@redhat.com
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 5/7] fsck: fix more bashisms
Date: Sun, 27 May 2018 20:52:27 -0700	[thread overview]
Message-ID: <0e373663-3c31-71f2-ddfe-aebd23bf573c@oracle.com> (raw)
In-Reply-To: <152728632778.22515.10077636373761717143.stgit@magnolia>

Alrighty, you can add my review
Reviewed by: Allison Henderson <allison.henderson@oracle.com>

On 05/25/2018 03:12 PM, 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>
> ---
>   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  https://urldefense.proofpoint.com/v2/url?u=http-3A__vger.kernel.org_majordomo-2Dinfo.html&d=DwICaQ&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=LHZQ8fHvy6wDKXGTWcm97burZH5sQKHRDMaY1UthQxc&m=esB0ntIPOKHhY_lkqtduLsdDYUrE4GycWhxY5h4WJLo&s=rMUHX1OjhARCGXqcRie_xKoEdOlq1hooycaZJzLEqX0&e=
> 

  reply	other threads:[~2018-05-28  3:52 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 [this message]
2018-05-28 14:02   ` Carlos Maiolino
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=0e373663-3c31-71f2-ddfe-aebd23bf573c@oracle.com \
    --to=allison.henderson@oracle.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).