diff options
-rw-r--r-- | fs/xfs/xfs_buf.c | 39 | ||||
-rw-r--r-- | fs/xfs/xfs_buf.h | 2 | ||||
-rw-r--r-- | fs/xfs/xfs_trans_buf.c | 9 |
3 files changed, 6 insertions, 44 deletions
diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c index 409a8a06642a..108eba7ad5c1 100644 --- a/fs/xfs/xfs_buf.c +++ b/fs/xfs/xfs_buf.c | |||
@@ -1074,45 +1074,6 @@ xfs_buf_ioerror_alert( | |||
1074 | (__uint64_t)XFS_BUF_ADDR(bp), func, -bp->b_error, bp->b_length); | 1074 | (__uint64_t)XFS_BUF_ADDR(bp), func, -bp->b_error, bp->b_length); |
1075 | } | 1075 | } |
1076 | 1076 | ||
1077 | /* | ||
1078 | * Same as xfs_bioerror, except that we are releasing the buffer | ||
1079 | * here ourselves, and avoiding the xfs_buf_ioend call. | ||
1080 | * This is meant for userdata errors; metadata bufs come with | ||
1081 | * iodone functions attached, so that we can track down errors. | ||
1082 | */ | ||
1083 | int | ||
1084 | xfs_bioerror_relse( | ||
1085 | struct xfs_buf *bp) | ||
1086 | { | ||
1087 | int64_t fl = bp->b_flags; | ||
1088 | /* | ||
1089 | * No need to wait until the buffer is unpinned. | ||
1090 | * We aren't flushing it. | ||
1091 | * | ||
1092 | * chunkhold expects B_DONE to be set, whether | ||
1093 | * we actually finish the I/O or not. We don't want to | ||
1094 | * change that interface. | ||
1095 | */ | ||
1096 | XFS_BUF_UNREAD(bp); | ||
1097 | XFS_BUF_DONE(bp); | ||
1098 | xfs_buf_stale(bp); | ||
1099 | bp->b_iodone = NULL; | ||
1100 | if (!(fl & XBF_ASYNC)) { | ||
1101 | /* | ||
1102 | * Mark b_error and B_ERROR _both_. | ||
1103 | * Lot's of chunkcache code assumes that. | ||
1104 | * There's no reason to mark error for | ||
1105 | * ASYNC buffers. | ||
1106 | */ | ||
1107 | xfs_buf_ioerror(bp, -EIO); | ||
1108 | complete(&bp->b_iowait); | ||
1109 | } else { | ||
1110 | xfs_buf_relse(bp); | ||
1111 | } | ||
1112 | |||
1113 | return -EIO; | ||
1114 | } | ||
1115 | |||
1116 | int | 1077 | int |
1117 | xfs_bwrite( | 1078 | xfs_bwrite( |
1118 | struct xfs_buf *bp) | 1079 | struct xfs_buf *bp) |
diff --git a/fs/xfs/xfs_buf.h b/fs/xfs/xfs_buf.h index 44db8cd67bda..d8f57f654f92 100644 --- a/fs/xfs/xfs_buf.h +++ b/fs/xfs/xfs_buf.h | |||
@@ -297,8 +297,6 @@ extern void xfs_buf_iomove(xfs_buf_t *, size_t, size_t, void *, | |||
297 | #define xfs_buf_zero(bp, off, len) \ | 297 | #define xfs_buf_zero(bp, off, len) \ |
298 | xfs_buf_iomove((bp), (off), (len), NULL, XBRW_ZERO) | 298 | xfs_buf_iomove((bp), (off), (len), NULL, XBRW_ZERO) |
299 | 299 | ||
300 | extern int xfs_bioerror_relse(struct xfs_buf *); | ||
301 | |||
302 | /* Buffer Utility Routines */ | 300 | /* Buffer Utility Routines */ |
303 | extern xfs_caddr_t xfs_buf_offset(xfs_buf_t *, size_t); | 301 | extern xfs_caddr_t xfs_buf_offset(xfs_buf_t *, size_t); |
304 | 302 | ||
diff --git a/fs/xfs/xfs_trans_buf.c b/fs/xfs/xfs_trans_buf.c index 96c898e7ac9a..db4be5b1d732 100644 --- a/fs/xfs/xfs_trans_buf.c +++ b/fs/xfs/xfs_trans_buf.c | |||
@@ -324,11 +324,14 @@ xfs_trans_read_buf_map( | |||
324 | */ | 324 | */ |
325 | if (XFS_FORCED_SHUTDOWN(mp)) { | 325 | if (XFS_FORCED_SHUTDOWN(mp)) { |
326 | trace_xfs_bdstrat_shut(bp, _RET_IP_); | 326 | trace_xfs_bdstrat_shut(bp, _RET_IP_); |
327 | xfs_bioerror_relse(bp); | 327 | bp->b_flags &= ~(XBF_READ | XBF_DONE); |
328 | } else { | 328 | xfs_buf_ioerror(bp, -EIO); |
329 | xfs_buf_iorequest(bp); | 329 | xfs_buf_stale(bp); |
330 | xfs_buf_relse(bp); | ||
331 | return -EIO; | ||
330 | } | 332 | } |
331 | 333 | ||
334 | xfs_buf_iorequest(bp); | ||
332 | error = xfs_buf_iowait(bp); | 335 | error = xfs_buf_iowait(bp); |
333 | if (error) { | 336 | if (error) { |
334 | xfs_buf_ioerror_alert(bp, __func__); | 337 | xfs_buf_ioerror_alert(bp, __func__); |