public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: linux-xfs@vger.kernel.org, hch@infradead.org,
	chandanrlinux@gmail.com, bfoster@redhat.com
Subject: Re: [PATCH 3/3] xfs: shorten the shutdown messages to a single line
Date: Mon, 21 Jun 2021 06:30:27 +0100	[thread overview]
Message-ID: <YNAj8xlFB/XnmVIn@infradead.org> (raw)
In-Reply-To: <162404245053.2377241.2678360661858649500.stgit@locust>

On Fri, Jun 18, 2021 at 11:54:10AM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
> 
> Consolidate the shutdown messages to a single line containing the
> reason, the passed-in flags, the source of the shutdown, and the end
> result.  This means we now only have one line to look for when
> debugging, which is useful when the fs goes down while something else is
> flooding dmesg.
> 
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> ---
>  fs/xfs/xfs_fsops.c |   16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
> 
> 
> diff --git a/fs/xfs/xfs_fsops.c b/fs/xfs/xfs_fsops.c
> index b7f979eca1e2..6ed29b158312 100644
> --- a/fs/xfs/xfs_fsops.c
> +++ b/fs/xfs/xfs_fsops.c
> @@ -538,25 +538,25 @@ xfs_do_force_shutdown(
>  
>  	if (flags & SHUTDOWN_FORCE_UMOUNT) {
>  		xfs_alert(mp,
> -"User initiated shutdown received. Shutting down filesystem");
> +"User initiated shutdown (0x%x) received. Shutting down filesystem",
> +				flags);
>  		return;
>  	}

So SHUTDOWN_FORCE_UMOUNT can actually be used together with
SHUTDOWN_LOG_IO_ERROR so printing something more specific could be
useful, although I'd prefer text over the hex flags.

>  	if (flags & SHUTDOWN_CORRUPT_INCORE) {
>  		xfs_alert_tag(mp, XFS_PTAG_SHUTDOWN_CORRUPT,
> -"Corruption of in-memory data detected.  Shutting down filesystem");
> +"Corruption of in-memory data (0x%x) detected at %pS (%s:%d).  Shutting down filesystem",
> +				flags, __return_address, fname, lnnum);
>  		if (XFS_ERRLEVEL_HIGH <= xfs_error_level)
>  			xfs_stack_trace();
>  	} else if (logerror) {
>  		xfs_alert_tag(mp, XFS_PTAG_SHUTDOWN_LOGERROR,
> -			"Log I/O Error Detected. Shutting down filesystem");
> +"Log I/O error (0x%x) detected at %pS (%s:%d). Shutting down filesystem",
> +				flags, __return_address, fname, lnnum);
>  	} else {
>  		xfs_alert_tag(mp, XFS_PTAG_SHUTDOWN_IOERROR,
> -			"I/O Error Detected. Shutting down filesystem");
> +"I/O error (0x%x) detected at %pS (%s:%d). Shutting down filesystem",
> +				flags, __return_address, fname, lnnum);
>  	}

However once we get here, flags can have exactly one specific value,
so printing it (especially as unreadable hex value) is completely
pointless.

  parent reply	other threads:[~2021-06-21  5:31 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-18 18:53 [PATCHSET v2 0/3] xfs: various small fixes and cleanups Darrick J. Wong
2021-06-18 18:53 ` [PATCH 1/3] xfs: fix type mismatches in the inode reclaim functions Darrick J. Wong
2021-06-20 22:23   ` Dave Chinner
2021-06-18 18:54 ` [PATCH 2/3] xfs: print name of function causing fs shutdown instead of hex pointer Darrick J. Wong
2021-06-20 22:24   ` Dave Chinner
2021-06-21  4:41   ` Chandan Babu R
2021-06-21  5:26   ` Christoph Hellwig
2021-06-18 18:54 ` [PATCH 3/3] xfs: shorten the shutdown messages to a single line Darrick J. Wong
2021-06-20 22:29   ` Dave Chinner
2021-06-21  4:41   ` Chandan Babu R
2021-06-21  5:30   ` Christoph Hellwig [this message]
2021-06-21  6:02     ` Dave Chinner
2021-06-21  6:06       ` Christoph Hellwig
2021-06-21  6:29         ` Dave Chinner
2021-06-21 16:56           ` Darrick J. Wong

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=YNAj8xlFB/XnmVIn@infradead.org \
    --to=hch@infradead.org \
    --cc=bfoster@redhat.com \
    --cc=chandanrlinux@gmail.com \
    --cc=djwong@kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    /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