diff options
Diffstat (limited to 'fs/xfs')
-rw-r--r-- | fs/xfs/xfs_bmap_util.c | 14 | ||||
-rw-r--r-- | fs/xfs/xfs_buf.c | 27 | ||||
-rw-r--r-- | fs/xfs/xfs_buf.h | 5 | ||||
-rw-r--r-- | fs/xfs/xfs_log_recover.c | 13 | ||||
-rw-r--r-- | fs/xfs/xfs_trans_buf.c | 13 |
5 files changed, 43 insertions, 29 deletions
diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c index 5887e41c0323..1394106ed22d 100644 --- a/fs/xfs/xfs_bmap_util.c +++ b/fs/xfs/xfs_bmap_util.c | |||
@@ -1187,7 +1187,12 @@ xfs_zero_remaining_bytes( | |||
1187 | XFS_BUF_UNWRITE(bp); | 1187 | XFS_BUF_UNWRITE(bp); |
1188 | XFS_BUF_READ(bp); | 1188 | XFS_BUF_READ(bp); |
1189 | XFS_BUF_SET_ADDR(bp, xfs_fsb_to_db(ip, imap.br_startblock)); | 1189 | XFS_BUF_SET_ADDR(bp, xfs_fsb_to_db(ip, imap.br_startblock)); |
1190 | xfsbdstrat(mp, bp); | 1190 | |
1191 | if (XFS_FORCED_SHUTDOWN(mp)) { | ||
1192 | error = XFS_ERROR(EIO); | ||
1193 | break; | ||
1194 | } | ||
1195 | xfs_buf_iorequest(bp); | ||
1191 | error = xfs_buf_iowait(bp); | 1196 | error = xfs_buf_iowait(bp); |
1192 | if (error) { | 1197 | if (error) { |
1193 | xfs_buf_ioerror_alert(bp, | 1198 | xfs_buf_ioerror_alert(bp, |
@@ -1200,7 +1205,12 @@ xfs_zero_remaining_bytes( | |||
1200 | XFS_BUF_UNDONE(bp); | 1205 | XFS_BUF_UNDONE(bp); |
1201 | XFS_BUF_UNREAD(bp); | 1206 | XFS_BUF_UNREAD(bp); |
1202 | XFS_BUF_WRITE(bp); | 1207 | XFS_BUF_WRITE(bp); |
1203 | xfsbdstrat(mp, bp); | 1208 | |
1209 | if (XFS_FORCED_SHUTDOWN(mp)) { | ||
1210 | error = XFS_ERROR(EIO); | ||
1211 | break; | ||
1212 | } | ||
1213 | xfs_buf_iorequest(bp); | ||
1204 | error = xfs_buf_iowait(bp); | 1214 | error = xfs_buf_iowait(bp); |
1205 | if (error) { | 1215 | if (error) { |
1206 | xfs_buf_ioerror_alert(bp, | 1216 | xfs_buf_ioerror_alert(bp, |
diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c index c7f0b77dcb00..9fa9c4304613 100644 --- a/fs/xfs/xfs_buf.c +++ b/fs/xfs/xfs_buf.c | |||
@@ -698,7 +698,11 @@ xfs_buf_read_uncached( | |||
698 | bp->b_flags |= XBF_READ; | 698 | bp->b_flags |= XBF_READ; |
699 | bp->b_ops = ops; | 699 | bp->b_ops = ops; |
700 | 700 | ||
701 | xfsbdstrat(target->bt_mount, bp); | 701 | if (XFS_FORCED_SHUTDOWN(target->bt_mount)) { |
702 | xfs_buf_relse(bp); | ||
703 | return NULL; | ||
704 | } | ||
705 | xfs_buf_iorequest(bp); | ||
702 | xfs_buf_iowait(bp); | 706 | xfs_buf_iowait(bp); |
703 | return bp; | 707 | return bp; |
704 | } | 708 | } |
@@ -1089,7 +1093,7 @@ xfs_bioerror( | |||
1089 | * This is meant for userdata errors; metadata bufs come with | 1093 | * This is meant for userdata errors; metadata bufs come with |
1090 | * iodone functions attached, so that we can track down errors. | 1094 | * iodone functions attached, so that we can track down errors. |
1091 | */ | 1095 | */ |
1092 | STATIC int | 1096 | int |
1093 | xfs_bioerror_relse( | 1097 | xfs_bioerror_relse( |
1094 | struct xfs_buf *bp) | 1098 | struct xfs_buf *bp) |
1095 | { | 1099 | { |
@@ -1164,25 +1168,6 @@ xfs_bwrite( | |||
1164 | return error; | 1168 | return error; |
1165 | } | 1169 | } |
1166 | 1170 | ||
1167 | /* | ||
1168 | * Wrapper around bdstrat so that we can stop data from going to disk in case | ||
1169 | * we are shutting down the filesystem. Typically user data goes thru this | ||
1170 | * path; one of the exceptions is the superblock. | ||
1171 | */ | ||
1172 | void | ||
1173 | xfsbdstrat( | ||
1174 | struct xfs_mount *mp, | ||
1175 | struct xfs_buf *bp) | ||
1176 | { | ||
1177 | if (XFS_FORCED_SHUTDOWN(mp)) { | ||
1178 | trace_xfs_bdstrat_shut(bp, _RET_IP_); | ||
1179 | xfs_bioerror_relse(bp); | ||
1180 | return; | ||
1181 | } | ||
1182 | |||
1183 | xfs_buf_iorequest(bp); | ||
1184 | } | ||
1185 | |||
1186 | STATIC void | 1171 | STATIC void |
1187 | _xfs_buf_ioend( | 1172 | _xfs_buf_ioend( |
1188 | xfs_buf_t *bp, | 1173 | xfs_buf_t *bp, |
diff --git a/fs/xfs/xfs_buf.h b/fs/xfs/xfs_buf.h index e65683361017..7e41b08017f7 100644 --- a/fs/xfs/xfs_buf.h +++ b/fs/xfs/xfs_buf.h | |||
@@ -269,9 +269,6 @@ extern void xfs_buf_unlock(xfs_buf_t *); | |||
269 | 269 | ||
270 | /* Buffer Read and Write Routines */ | 270 | /* Buffer Read and Write Routines */ |
271 | extern int xfs_bwrite(struct xfs_buf *bp); | 271 | extern int xfs_bwrite(struct xfs_buf *bp); |
272 | |||
273 | extern void xfsbdstrat(struct xfs_mount *, struct xfs_buf *); | ||
274 | |||
275 | extern void xfs_buf_ioend(xfs_buf_t *, int); | 272 | extern void xfs_buf_ioend(xfs_buf_t *, int); |
276 | extern void xfs_buf_ioerror(xfs_buf_t *, int); | 273 | extern void xfs_buf_ioerror(xfs_buf_t *, int); |
277 | extern void xfs_buf_ioerror_alert(struct xfs_buf *, const char *func); | 274 | extern void xfs_buf_ioerror_alert(struct xfs_buf *, const char *func); |
@@ -282,6 +279,8 @@ extern void xfs_buf_iomove(xfs_buf_t *, size_t, size_t, void *, | |||
282 | #define xfs_buf_zero(bp, off, len) \ | 279 | #define xfs_buf_zero(bp, off, len) \ |
283 | xfs_buf_iomove((bp), (off), (len), NULL, XBRW_ZERO) | 280 | xfs_buf_iomove((bp), (off), (len), NULL, XBRW_ZERO) |
284 | 281 | ||
282 | extern int xfs_bioerror_relse(struct xfs_buf *); | ||
283 | |||
285 | static inline int xfs_buf_geterror(xfs_buf_t *bp) | 284 | static inline int xfs_buf_geterror(xfs_buf_t *bp) |
286 | { | 285 | { |
287 | return bp ? bp->b_error : ENOMEM; | 286 | return bp ? bp->b_error : ENOMEM; |
diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c index b6b669df40f3..eae16920655b 100644 --- a/fs/xfs/xfs_log_recover.c +++ b/fs/xfs/xfs_log_recover.c | |||
@@ -193,7 +193,10 @@ xlog_bread_noalign( | |||
193 | bp->b_io_length = nbblks; | 193 | bp->b_io_length = nbblks; |
194 | bp->b_error = 0; | 194 | bp->b_error = 0; |
195 | 195 | ||
196 | xfsbdstrat(log->l_mp, bp); | 196 | if (XFS_FORCED_SHUTDOWN(log->l_mp)) |
197 | return XFS_ERROR(EIO); | ||
198 | |||
199 | xfs_buf_iorequest(bp); | ||
197 | error = xfs_buf_iowait(bp); | 200 | error = xfs_buf_iowait(bp); |
198 | if (error) | 201 | if (error) |
199 | xfs_buf_ioerror_alert(bp, __func__); | 202 | xfs_buf_ioerror_alert(bp, __func__); |
@@ -4397,7 +4400,13 @@ xlog_do_recover( | |||
4397 | XFS_BUF_READ(bp); | 4400 | XFS_BUF_READ(bp); |
4398 | XFS_BUF_UNASYNC(bp); | 4401 | XFS_BUF_UNASYNC(bp); |
4399 | bp->b_ops = &xfs_sb_buf_ops; | 4402 | bp->b_ops = &xfs_sb_buf_ops; |
4400 | xfsbdstrat(log->l_mp, bp); | 4403 | |
4404 | if (XFS_FORCED_SHUTDOWN(log->l_mp)) { | ||
4405 | xfs_buf_relse(bp); | ||
4406 | return XFS_ERROR(EIO); | ||
4407 | } | ||
4408 | |||
4409 | xfs_buf_iorequest(bp); | ||
4401 | error = xfs_buf_iowait(bp); | 4410 | error = xfs_buf_iowait(bp); |
4402 | if (error) { | 4411 | if (error) { |
4403 | xfs_buf_ioerror_alert(bp, __func__); | 4412 | xfs_buf_ioerror_alert(bp, __func__); |
diff --git a/fs/xfs/xfs_trans_buf.c b/fs/xfs/xfs_trans_buf.c index c035d11b7734..647b6f1d8923 100644 --- a/fs/xfs/xfs_trans_buf.c +++ b/fs/xfs/xfs_trans_buf.c | |||
@@ -314,7 +314,18 @@ xfs_trans_read_buf_map( | |||
314 | ASSERT(bp->b_iodone == NULL); | 314 | ASSERT(bp->b_iodone == NULL); |
315 | XFS_BUF_READ(bp); | 315 | XFS_BUF_READ(bp); |
316 | bp->b_ops = ops; | 316 | bp->b_ops = ops; |
317 | xfsbdstrat(tp->t_mountp, bp); | 317 | |
318 | /* | ||
319 | * XXX(hch): clean up the error handling here to be less | ||
320 | * of a mess.. | ||
321 | */ | ||
322 | if (XFS_FORCED_SHUTDOWN(mp)) { | ||
323 | trace_xfs_bdstrat_shut(bp, _RET_IP_); | ||
324 | xfs_bioerror_relse(bp); | ||
325 | } else { | ||
326 | xfs_buf_iorequest(bp); | ||
327 | } | ||
328 | |||
318 | error = xfs_buf_iowait(bp); | 329 | error = xfs_buf_iowait(bp); |
319 | if (error) { | 330 | if (error) { |
320 | xfs_buf_ioerror_alert(bp, __func__); | 331 | xfs_buf_ioerror_alert(bp, __func__); |