Brian Foster 9bdd9bd69b xfs: buffer ->bi_end_io function requires irq-safe lock
Reports have surfaced of a lockdep splat complaining about an
irq-safe -> irq-unsafe locking order in the xfs_buf_bio_end_io() bio
completion handler. This only occurs when I/O errors are present
because bp->b_lock is only acquired in this context to protect
setting an error on the buffer. The problem is that this lock can be
acquired with the (request_queue) q->queue_lock held. See
scsi_end_request() or ata_qc_schedule_eh(), for example.

Replace the locked test/set of b_io_error with a cmpxchg() call.
This eliminates the need for the lock and thus the lock ordering
problem goes away.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
2016-05-18 10:56:41 +10:00
..
2014-07-30 09:12:05 +10:00
2016-03-18 11:42:53 -04:00
2013-05-07 18:45:36 -05:00
2011-08-12 16:21:35 -05:00
2012-11-19 20:11:24 -06:00
2016-03-21 11:53:05 -07:00
2016-03-21 11:53:05 -07:00
2013-08-12 16:53:39 -05:00
2016-03-21 11:53:05 -07:00
2016-02-10 15:01:30 +11:00
2011-08-12 16:21:35 -05:00
2015-06-22 09:44:02 +10:00
2011-08-12 16:21:35 -05:00
2016-02-09 16:54:58 +11:00
2013-08-12 16:56:06 -05:00
2016-02-09 16:54:58 +11:00
2016-03-11 10:21:32 -08:00
2013-05-07 18:45:36 -05:00
2016-01-22 18:04:28 -05:00
2016-03-18 11:42:53 -04:00
2013-05-07 18:45:36 -05:00