public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Brian Foster <bfoster@redhat.com>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: xfs <linux-xfs@vger.kernel.org>
Subject: Re: [PATCH] xfs: fix broken log reservation debugging
Date: Fri, 24 May 2019 08:39:05 -0400	[thread overview]
Message-ID: <20190524123904.GA33461@bfoster> (raw)
In-Reply-To: <20190523160219.GH5141@magnolia>

On Thu, May 23, 2019 at 09:02:19AM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> xlog_print_tic_res() is supposed to print a human readable string for
> each element of the log ticket reservation array.  Unfortunately, I
> forgot to update the string array when we added rmap & reflink support,
> so the debug message prints "region[3]: (null) - 352 bytes" which isn't
> useful at all.  Add the missing elements and add a build check so that
> we don't forget again to add a string when adding a new XLOG_REG_TYPE.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---

Reviewed-by: Brian Foster <bfoster@redhat.com>

>  fs/xfs/xfs_log.c |   11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
> index 457ced3ee3e1..2466b0f5b6c4 100644
> --- a/fs/xfs/xfs_log.c
> +++ b/fs/xfs/xfs_log.c
> @@ -2069,7 +2069,7 @@ xlog_print_tic_res(
>  
>  	/* match with XLOG_REG_TYPE_* in xfs_log.h */
>  #define REG_TYPE_STR(type, str)	[XLOG_REG_TYPE_##type] = str
> -	static char *res_type_str[XLOG_REG_TYPE_MAX + 1] = {
> +	static char *res_type_str[] = {
>  	    REG_TYPE_STR(BFORMAT, "bformat"),
>  	    REG_TYPE_STR(BCHUNK, "bchunk"),
>  	    REG_TYPE_STR(EFI_FORMAT, "efi_format"),
> @@ -2089,8 +2089,15 @@ xlog_print_tic_res(
>  	    REG_TYPE_STR(UNMOUNT, "unmount"),
>  	    REG_TYPE_STR(COMMIT, "commit"),
>  	    REG_TYPE_STR(TRANSHDR, "trans header"),
> -	    REG_TYPE_STR(ICREATE, "inode create")
> +	    REG_TYPE_STR(ICREATE, "inode create"),
> +	    REG_TYPE_STR(RUI_FORMAT, "rui_format"),
> +	    REG_TYPE_STR(RUD_FORMAT, "rud_format"),
> +	    REG_TYPE_STR(CUI_FORMAT, "cui_format"),
> +	    REG_TYPE_STR(CUD_FORMAT, "cud_format"),
> +	    REG_TYPE_STR(BUI_FORMAT, "bui_format"),
> +	    REG_TYPE_STR(BUD_FORMAT, "bud_format"),
>  	};
> +	BUILD_BUG_ON(ARRAY_SIZE(res_type_str) != XLOG_REG_TYPE_MAX + 1);
>  #undef REG_TYPE_STR
>  
>  	xfs_warn(mp, "ticket reservation summary:");

      reply	other threads:[~2019-05-24 12:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-23 16:02 [PATCH] xfs: fix broken log reservation debugging Darrick J. Wong
2019-05-24 12:39 ` 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=20190524123904.GA33461@bfoster \
    --to=bfoster@redhat.com \
    --cc=darrick.wong@oracle.com \
    --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