[01/19] xfs: complain when we don't recognize the log item type
diff mbox series

Message ID 158752116938.2140829.6588657626837150802.stgit@magnolia
State New
Headers show
Series
  • xfs: refactor log recovery
Related show

Commit Message

Darrick J. Wong April 22, 2020, 2:06 a.m. UTC
From: Darrick J. Wong <darrick.wong@oracle.com>

When we're sorting recovered log items ahead of recovering them and
encounter a log item of unknown type, actually print the type code when
we're rejecting the whole transaction to aid in debugging.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 fs/xfs/xfs_log_recover.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Brian Foster April 22, 2020, 4:17 p.m. UTC | #1
On Tue, Apr 21, 2020 at 07:06:09PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> When we're sorting recovered log items ahead of recovering them and
> encounter a log item of unknown type, actually print the type code when
> we're rejecting the whole transaction to aid in debugging.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---

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

>  fs/xfs/xfs_log_recover.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> 
> diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
> index 11c3502b07b1..5f803083ddc3 100644
> --- a/fs/xfs/xfs_log_recover.c
> +++ b/fs/xfs/xfs_log_recover.c
> @@ -1887,8 +1887,8 @@ xlog_recover_reorder_trans(
>  			break;
>  		default:
>  			xfs_warn(log->l_mp,
> -				"%s: unrecognized type of log operation",
> -				__func__);
> +				"%s: unrecognized type of log operation (%d)",
> +				__func__, ITEM_TYPE(item));
>  			ASSERT(0);
>  			/*
>  			 * return the remaining items back to the transaction
>
Christoph Hellwig April 25, 2020, 5:42 p.m. UTC | #2
On Tue, Apr 21, 2020 at 07:06:09PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> When we're sorting recovered log items ahead of recovering them and
> encounter a log item of unknown type, actually print the type code when
> we're rejecting the whole transaction to aid in debugging.

The subject seems wrong - we already complain, we are just not very
specific what we complain about as you mention in the actual commit log.

With a fixed subject:

Reviewed-by: Christoph Hellwig <hch@lst.de>
Darrick J. Wong April 27, 2020, 5:55 p.m. UTC | #3
On Sat, Apr 25, 2020 at 10:42:10AM -0700, Christoph Hellwig wrote:
> On Tue, Apr 21, 2020 at 07:06:09PM -0700, Darrick J. Wong wrote:
> > From: Darrick J. Wong <darrick.wong@oracle.com>
> > 
> > When we're sorting recovered log items ahead of recovering them and
> > encounter a log item of unknown type, actually print the type code when
> > we're rejecting the whole transaction to aid in debugging.
> 
> The subject seems wrong - we already complain, we are just not very
> specific what we complain about as you mention in the actual commit log.
> 
> With a fixed subject:

ok, changed to:
"xfs: report unrecognized log item type codes during recovery"

--D

> 
> Reviewed-by: Christoph Hellwig <hch@lst.de>

Patch
diff mbox series

diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
index 11c3502b07b1..5f803083ddc3 100644
--- a/fs/xfs/xfs_log_recover.c
+++ b/fs/xfs/xfs_log_recover.c
@@ -1887,8 +1887,8 @@  xlog_recover_reorder_trans(
 			break;
 		default:
 			xfs_warn(log->l_mp,
-				"%s: unrecognized type of log operation",
-				__func__);
+				"%s: unrecognized type of log operation (%d)",
+				__func__, ITEM_TYPE(item));
 			ASSERT(0);
 			/*
 			 * return the remaining items back to the transaction