linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] xfs: fix panics seen with error injection
@ 2018-11-07 20:10 Josef Bacik
  2018-11-07 20:10 ` [PATCH 1/2] xfs: change xfs_buf_ioapply_map to STATIC Josef Bacik
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Josef Bacik @ 2018-11-07 20:10 UTC (permalink / raw)
  To: kernel-team, linux-xfs

I have been trying to debug a xfs hang that happens sometimes when NBD
disconnects, but when trying to do error injection the box just falls over right
away with a panic trying to access an xfs_buf that has been freed.  I hit this
consistently with the reproducer you can find here

https://github.com/josefbacik/debug-scripts/tree/master/xfs-hang

You need to have bcc installed, have the error injection stuff turned on, and
just run

./reproducer.sh

You'll want to modify test.sh to point at wherever your fsstress is, and
whatever device you want it to use.  It'll walk through functions injecting
errors and usually craps out when it hits xfs_btree_log_recs.

What the script does is triggers on whatever function you are looking at
(xfs_btree_log_recs for example) and then anything that dirties a xfs_buf in
that path will save that xfs_buf for later.  Then when we go to do
xfs_buf_ioapply_map on that buf (which eventually calls submit_bio) we'll fail
that bio.  Xfs errors out and things carry on.

In my testing however it seems like we're dropping the ref on failed xfs_buf's
prematurely, so they get freed before we're able to add them to the delwri list
to be retried.  The 2/2 patch fixes this problem.  The 1/2 patch makes it
possible for the reproducer to work, as it relies on being able to attach a
kprobe/kretprobe at xfs_buf_ioapply_map.

With this patch xfs doesn't fall over as soon as I start trying to reproduce the
hang I'm actually trying to find.  Thanks,

Josef

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

end of thread, other threads:[~2018-11-15 20:26 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-07 20:10 [PATCH 0/2] xfs: fix panics seen with error injection Josef Bacik
2018-11-07 20:10 ` [PATCH 1/2] xfs: change xfs_buf_ioapply_map to STATIC Josef Bacik
2018-11-15 10:19   ` Christoph Hellwig
2018-11-07 20:10 ` [PATCH 2/2] xfs: take a ref on failed bufs in xfs_inode_item_push Josef Bacik
2018-11-07 23:37   ` Dave Chinner
2018-11-07 23:43     ` Josef Bacik
2018-11-08  0:48       ` Dave Chinner
2018-11-08  1:43         ` Josef Bacik
2018-11-07 23:57     ` Josef Bacik
2018-11-08 19:36     ` Josef Bacik
2018-11-12 14:23     ` Josef Bacik
2018-11-13  5:12       ` Darrick J. Wong
2018-11-14  8:10       ` Dave Chinner
2018-11-07 22:55 ` [PATCH 0/2] xfs: fix panics seen with error injection Dave Chinner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).