Linux XFS filesystem development
 help / color / mirror / Atom feed
* Assertion fails on xfs_db when setting erroneous type
@ 2018-04-17 12:23 Carlos Maiolino
  2018-04-17 15:33 ` Darrick J. Wong
  2018-04-17 16:53 ` Eric Sandeen
  0 siblings, 2 replies; 4+ messages in thread
From: Carlos Maiolino @ 2018-04-17 12:23 UTC (permalink / raw)
  To: linux-xfs

Hi,

recently while playing with a FS image, I've hit an assertion in xfs_db:

xfs_db: print.c:164: print_flist_1: Assertion `fa->arg & 64' failed.
Aborted (core dumped)

The reason for this assert was that I tried to print a remote attr3 block, after
having set the block pointer to a random, no attr3 location.

I wonder if crashing xfs_db here is the right thing to do?


I've written a small workaround for it as below:


@@ -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(_("Invalid arg\n"));
                        }
                }
                free_strvec(pfx);


I wonder if something like this makes sense or not? I'm still familiarizing
myself with xfs_db code, so I'm not sure if something as the small patch above
is a valid fix for it or not, but I believe exiting xfs_db just because somebody
tried to print a metadata block using a different type from the on-disk block
being read doesn't look like the right thing to do.

Comments?

Cheers

-- 
Carlos

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-04-18  7:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-17 12:23 Assertion fails on xfs_db when setting erroneous type Carlos Maiolino
2018-04-17 15:33 ` Darrick J. Wong
2018-04-18  7:15   ` Carlos Maiolino
2018-04-17 16:53 ` Eric Sandeen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox