diff options
author | Dave Chinner <dchinner@redhat.com> | 2012-04-23 01:58:46 -0400 |
---|---|---|
committer | Ben Myers <bpm@sgi.com> | 2012-05-14 17:20:42 -0400 |
commit | 0e95f19ad983e72a9cb93a67b3290b58f0467b36 (patch) | |
tree | 2b3117e20f1e739d5cb560b1b1b32f3fdc8e3ee5 /fs/xfs/xfs_log_recover.c | |
parent | fe2429b0966a7ec42b5fe3bf96f0f10de0a3b536 (diff) |
xfs: check for buffer errors before waiting
If we call xfs_buf_iowait() on a buffer that failed dispatch due to
an IO error, it will wait forever for an Io that does not exist.
This is hndled in xfs_buf_read, but there is other code that calls
xfs_buf_iowait directly that doesn't.
Rather than make the call sites have to handle checking for dispatch
errors and then checking for completion errors, make
xfs_buf_iowait() check for dispatch errors on the buffer before
waiting. This means we handle both dispatch and completion errors
with one set of error handling at the caller sites.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_log_recover.c')
-rw-r--r-- | fs/xfs/xfs_log_recover.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c index 5540e79da6f5..e1577e763fdf 100644 --- a/fs/xfs/xfs_log_recover.c +++ b/fs/xfs/xfs_log_recover.c | |||
@@ -179,6 +179,7 @@ xlog_bread_noalign( | |||
179 | XFS_BUF_SET_ADDR(bp, log->l_logBBstart + blk_no); | 179 | XFS_BUF_SET_ADDR(bp, log->l_logBBstart + blk_no); |
180 | XFS_BUF_READ(bp); | 180 | XFS_BUF_READ(bp); |
181 | XFS_BUF_SET_COUNT(bp, BBTOB(nbblks)); | 181 | XFS_BUF_SET_COUNT(bp, BBTOB(nbblks)); |
182 | bp->b_error = 0; | ||
182 | 183 | ||
183 | xfsbdstrat(log->l_mp, bp); | 184 | xfsbdstrat(log->l_mp, bp); |
184 | error = xfs_buf_iowait(bp); | 185 | error = xfs_buf_iowait(bp); |
@@ -266,6 +267,7 @@ xlog_bwrite( | |||
266 | xfs_buf_hold(bp); | 267 | xfs_buf_hold(bp); |
267 | xfs_buf_lock(bp); | 268 | xfs_buf_lock(bp); |
268 | XFS_BUF_SET_COUNT(bp, BBTOB(nbblks)); | 269 | XFS_BUF_SET_COUNT(bp, BBTOB(nbblks)); |
270 | bp->b_error = 0; | ||
269 | 271 | ||
270 | error = xfs_bwrite(bp); | 272 | error = xfs_bwrite(bp); |
271 | if (error) | 273 | if (error) |