From a023e1af046c190c9782b2ecd814cd28bcdb4e39 Mon Sep 17 00:00:00 2001 From: Carlos Maiolino Date: Thu, 31 May 2018 14:10:42 -0500 Subject: [PATCH] xfs_db: Don't ASSERT on unrecognized metadata For some types, (for example attr3) if the metadata is not recognized as the requested type, we can hit an ASSERT when trying to print the type: xfs_db: print.c:164: print_flist_1: Assertion `fa->arg & 64' failed. Aborted (core dumped) This can happen for corrupted metadata or even just a misdirected user command; there's no reason to ASSERT. If we get here, print something helpful and carry on. [sandeen: write the commit log] Signed-off-by: Carlos Maiolino Reviewed-by: Darrick J. Wong Signed-off-by: Eric Sandeen --- db/print.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/db/print.c b/db/print.c index 0da36c278..f8a482810 100644 --- a/db/print.c +++ b/db/print.c @@ -160,9 +160,10 @@ print_flist_1( (f->flags & FLD_ARRAY) != 0); if (neednl) dbprintf("\n"); - } else { - ASSERT(fa->arg & FTARG_OKEMPTY); + } else if (fa->arg & FTARG_OKEMPTY) { dbprintf(_("(empty)\n")); + } else { + dbprintf(_("Unrecognized metadata or type mismatch\n")); } } free_strvec(pfx); -- 2.47.2