From: Brian Foster <bfoster@redhat.com>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: Eric Sandeen <sandeen@redhat.com>, xfs <linux-xfs@vger.kernel.org>
Subject: Re: [PATCH] xfs_admin: don't hide the xfs_repair output when upgrading
Date: Mon, 8 Mar 2021 07:17:07 -0500 [thread overview]
Message-ID: <YEYVw8xCPZsNL0Hn@bfoster> (raw)
In-Reply-To: <20210305220021.GI3419940@magnolia>
On Fri, Mar 05, 2021 at 02:00:21PM -0800, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
>
> Currently, xfs_admin suppresses the output from xfs_repair when it tries
> to upgrade a filesystem, and prints a rather unhelpful message if the
> upgrade fails.
>
> Neither of these behaviors are useful -- repair can fail for reasons
> outside of the filesystem being mounted, and if it does, the admin will
> never know what actually happened.
>
> Worse yet, if repair finds corruptions on disk, the upgrade script
> silently throws all that away, which means that nobody will ever be able
> to report what happened if an upgrade trashes a filesystem.
>
> Therefore, allow the console to capture all of repair's stdout/stderr
> reports.
>
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> ---
Personally, I prefer either the current behavior where a user can always
run xfs_repair directly to see the low level output, or even the verbose
flag option since ISTM that if repair fails, it's going to fail the next
time around for similar reasons in the most common cases. That said, I'm
not tied to any particular behavior and we've had negative feedback on
the current approach, so:
Reviewed-by: Brian Foster <bfoster@redhat.com>
> db/xfs_admin.sh | 12 ++----------
> 1 file changed, 2 insertions(+), 10 deletions(-)
>
> diff --git a/db/xfs_admin.sh b/db/xfs_admin.sh
> index 02f34b73..916050cb 100755
> --- a/db/xfs_admin.sh
> +++ b/db/xfs_admin.sh
> @@ -51,17 +51,9 @@ case $# in
> fi
> if [ -n "$REPAIR_OPTS" ]
> then
> - # Hide normal repair output which is sent to stderr
> - # assuming the filesystem is fine when a user is
> - # running xfs_admin.
> - # Ideally, we need to improve the output behaviour
> - # of repair for this purpose (say a "quiet" mode).
> - eval xfs_repair $REPAIR_DEV_OPTS $REPAIR_OPTS "$1" 2> /dev/null
> + echo "Running xfs_repair to upgrade filesystem."
> + eval xfs_repair $REPAIR_DEV_OPTS $REPAIR_OPTS "$1"
> status=`expr $? + $status`
> - if [ $status -ne 0 ]
> - then
> - echo "Conversion failed, is the filesystem unmounted?"
> - fi
> fi
> ;;
> *) echo $USAGE 1>&2
>
prev parent reply other threads:[~2021-03-08 12:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-05 22:00 [PATCH] xfs_admin: don't hide the xfs_repair output when upgrading Darrick J. Wong
2021-03-08 12:17 ` Brian Foster [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=YEYVw8xCPZsNL0Hn@bfoster \
--to=bfoster@redhat.com \
--cc=djwong@kernel.org \
--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