From: Carlos Maiolino Date: Thu, 31 May 2018 19:10:42 +0000 (-0500) Subject: xfs_db: Don't ASSERT on unrecognized metadata X-Git-Tag: v4.17.0-rc1~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a023e1af046c190c9782b2ecd814cd28bcdb4e39;p=thirdparty%2Fxfsprogs-dev.git 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 --- 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);