Skip to content

Commit

Permalink
xfs: prevent recursion in xfs_buf_iorequest
Browse files Browse the repository at this point in the history
If the b_iodone handler is run in calling context in xfs_buf_iorequest we
can run into a recursion where xfs_buf_iodone_callbacks keeps calling back
into xfs_buf_iorequest because an I/O error happened, which keeps calling
back into xfs_buf_iorequest.  This chain will usually not take long
because the filesystem gets shut down because of log I/O errors, but even
over a short time it can cause stack overflows if run on the same context.

As a short term workaround make sure we always call the iodone handler in
workqueue context.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
  • Loading branch information
Christoph Hellwig authored and Ben Myers committed Jul 13, 2012
1 parent aa29284 commit 40a9b79
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/xfs/xfs_buf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1243,7 +1243,7 @@ xfs_buf_iorequest(
*/
atomic_set(&bp->b_io_remaining, 1);
_xfs_buf_ioapply(bp);
_xfs_buf_ioend(bp, 0);
_xfs_buf_ioend(bp, 1);

xfs_buf_rele(bp);
}
Expand Down

0 comments on commit 40a9b79

Please sign in to comment.