aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Scott <nathans@sgi.com>2006-06-09 00:58:38 -0400
committerNathan Scott <nathans@sgi.com>2006-06-09 00:58:38 -0400
commit7d04a335b6b2d79e3742ffd28bd651204574e794 (patch)
tree2b687202ae47c5e0c70a2b921b77135066131d8d
parentb76963fac4a17b661bad46e5a57b0f918c6f0cd1 (diff)
[XFS] Shutdown the filesystem if all device paths have gone. Made
shutdown vop flags consistent with sync vop flags declarations too. SGI-PV: 939911 SGI-Modid: xfs-linux-melb:xfs-kern:26096a Signed-off-by: Nathan Scott <nathans@sgi.com>
-rw-r--r--fs/xfs/linux-2.6/xfs_aops.c15
-rw-r--r--fs/xfs/linux-2.6/xfs_aops.h2
-rw-r--r--fs/xfs/linux-2.6/xfs_vfs.h7
-rw-r--r--fs/xfs/linux-2.6/xfs_vnode.c16
-rw-r--r--fs/xfs/linux-2.6/xfs_vnode.h2
-rw-r--r--fs/xfs/quota/xfs_dquot.c2
-rw-r--r--fs/xfs/xfs_bmap.c4
-rw-r--r--fs/xfs/xfs_buf_item.c2
-rw-r--r--fs/xfs/xfs_fsops.c7
-rw-r--r--fs/xfs/xfs_inode.c4
-rw-r--r--fs/xfs/xfs_log.c10
-rw-r--r--fs/xfs/xfs_log_recover.c2
-rw-r--r--fs/xfs/xfs_mount.h9
-rw-r--r--fs/xfs/xfs_rw.c36
-rw-r--r--fs/xfs/xfs_trans.c4
-rw-r--r--fs/xfs/xfs_trans_ail.c5
-rw-r--r--fs/xfs/xfs_trans_buf.c6
-rw-r--r--fs/xfs/xfs_vnodeops.c2
18 files changed, 78 insertions, 57 deletions
diff --git a/fs/xfs/linux-2.6/xfs_aops.c b/fs/xfs/linux-2.6/xfs_aops.c
index 4d191ef39b67..1fcdc0abda6e 100644
--- a/fs/xfs/linux-2.6/xfs_aops.c
+++ b/fs/xfs/linux-2.6/xfs_aops.c
@@ -136,9 +136,10 @@ xfs_destroy_ioend(
136 136
137 for (bh = ioend->io_buffer_head; bh; bh = next) { 137 for (bh = ioend->io_buffer_head; bh; bh = next) {
138 next = bh->b_private; 138 next = bh->b_private;
139 bh->b_end_io(bh, ioend->io_uptodate); 139 bh->b_end_io(bh, !ioend->io_error);
140 } 140 }
141 141 if (unlikely(ioend->io_error))
142 vn_ioerror(ioend->io_vnode, ioend->io_error, __FILE__,__LINE__);
142 vn_iowake(ioend->io_vnode); 143 vn_iowake(ioend->io_vnode);
143 mempool_free(ioend, xfs_ioend_pool); 144 mempool_free(ioend, xfs_ioend_pool);
144} 145}
@@ -185,7 +186,7 @@ xfs_end_bio_unwritten(
185 size_t size = ioend->io_size; 186 size_t size = ioend->io_size;
186 int error; 187 int error;
187 188
188 if (ioend->io_uptodate) 189 if (likely(!ioend->io_error))
189 VOP_BMAP(vp, offset, size, BMAPI_UNWRITTEN, NULL, NULL, error); 190 VOP_BMAP(vp, offset, size, BMAPI_UNWRITTEN, NULL, NULL, error);
190 xfs_destroy_ioend(ioend); 191 xfs_destroy_ioend(ioend);
191} 192}
@@ -211,7 +212,7 @@ xfs_alloc_ioend(
211 * all the I/O from calling the completion routine too early. 212 * all the I/O from calling the completion routine too early.
212 */ 213 */
213 atomic_set(&ioend->io_remaining, 1); 214 atomic_set(&ioend->io_remaining, 1);
214 ioend->io_uptodate = 1; /* cleared if any I/O fails */ 215 ioend->io_error = 0;
215 ioend->io_list = NULL; 216 ioend->io_list = NULL;
216 ioend->io_type = type; 217 ioend->io_type = type;
217 ioend->io_vnode = vn_from_inode(inode); 218 ioend->io_vnode = vn_from_inode(inode);
@@ -271,16 +272,14 @@ xfs_end_bio(
271 if (bio->bi_size) 272 if (bio->bi_size)
272 return 1; 273 return 1;
273 274
274 ASSERT(ioend);
275 ASSERT(atomic_read(&bio->bi_cnt) >= 1); 275 ASSERT(atomic_read(&bio->bi_cnt) >= 1);
276 ioend->io_error = test_bit(BIO_UPTODATE, &bio->bi_flags) ? 0 : error;
276 277
277 /* Toss bio and pass work off to an xfsdatad thread */ 278 /* Toss bio and pass work off to an xfsdatad thread */
278 if (!test_bit(BIO_UPTODATE, &bio->bi_flags))
279 ioend->io_uptodate = 0;
280 bio->bi_private = NULL; 279 bio->bi_private = NULL;
281 bio->bi_end_io = NULL; 280 bio->bi_end_io = NULL;
282
283 bio_put(bio); 281 bio_put(bio);
282
284 xfs_finish_ioend(ioend); 283 xfs_finish_ioend(ioend);
285 return 0; 284 return 0;
286} 285}
diff --git a/fs/xfs/linux-2.6/xfs_aops.h b/fs/xfs/linux-2.6/xfs_aops.h
index 60716543c68b..41c7d2da638a 100644
--- a/fs/xfs/linux-2.6/xfs_aops.h
+++ b/fs/xfs/linux-2.6/xfs_aops.h
@@ -30,7 +30,7 @@ typedef void (*xfs_ioend_func_t)(void *);
30typedef struct xfs_ioend { 30typedef struct xfs_ioend {
31 struct xfs_ioend *io_list; /* next ioend in chain */ 31 struct xfs_ioend *io_list; /* next ioend in chain */
32 unsigned int io_type; /* delalloc / unwritten */ 32 unsigned int io_type; /* delalloc / unwritten */
33 unsigned int io_uptodate; /* I/O status register */ 33 int io_error; /* I/O error code */
34 atomic_t io_remaining; /* hold count */ 34 atomic_t io_remaining; /* hold count */
35 struct vnode *io_vnode; /* file being written to */ 35 struct vnode *io_vnode; /* file being written to */
36 struct buffer_head *io_buffer_head;/* buffer linked list head */ 36 struct buffer_head *io_buffer_head;/* buffer linked list head */
diff --git a/fs/xfs/linux-2.6/xfs_vfs.h b/fs/xfs/linux-2.6/xfs_vfs.h
index 841200c03092..2ca05043a0fd 100644
--- a/fs/xfs/linux-2.6/xfs_vfs.h
+++ b/fs/xfs/linux-2.6/xfs_vfs.h
@@ -94,6 +94,13 @@ typedef enum {
94#define SYNC_REMOUNT 0x0080 /* remount readonly, no dummy LRs */ 94#define SYNC_REMOUNT 0x0080 /* remount readonly, no dummy LRs */
95#define SYNC_QUIESCE 0x0100 /* quiesce filesystem for a snapshot */ 95#define SYNC_QUIESCE 0x0100 /* quiesce filesystem for a snapshot */
96 96
97#define SHUTDOWN_META_IO_ERROR 0x0001 /* write attempt to metadata failed */
98#define SHUTDOWN_LOG_IO_ERROR 0x0002 /* write attempt to the log failed */
99#define SHUTDOWN_FORCE_UMOUNT 0x0004 /* shutdown from a forced unmount */
100#define SHUTDOWN_CORRUPT_INCORE 0x0008 /* corrupt in-memory data structures */
101#define SHUTDOWN_REMOTE_REQ 0x0010 /* shutdown came from remote cell */
102#define SHUTDOWN_DEVICE_REQ 0x0020 /* failed all paths to the device */
103
97typedef int (*vfs_mount_t)(bhv_desc_t *, 104typedef int (*vfs_mount_t)(bhv_desc_t *,
98 struct xfs_mount_args *, struct cred *); 105 struct xfs_mount_args *, struct cred *);
99typedef int (*vfs_parseargs_t)(bhv_desc_t *, char *, 106typedef int (*vfs_parseargs_t)(bhv_desc_t *, char *,
diff --git a/fs/xfs/linux-2.6/xfs_vnode.c b/fs/xfs/linux-2.6/xfs_vnode.c
index d27c25b27ccd..f17e39cff230 100644
--- a/fs/xfs/linux-2.6/xfs_vnode.c
+++ b/fs/xfs/linux-2.6/xfs_vnode.c
@@ -54,6 +54,22 @@ vn_iowake(
54 wake_up(vptosync(vp)); 54 wake_up(vptosync(vp));
55} 55}
56 56
57/*
58 * Volume managers supporting multiple paths can send back ENODEV when the
59 * final path disappears. In this case continuing to fill the page cache
60 * with dirty data which cannot be written out is evil, so prevent that.
61 */
62void
63vn_ioerror(
64 struct vnode *vp,
65 int error,
66 char *f,
67 int l)
68{
69 if (unlikely(error == -ENODEV))
70 VFS_FORCE_SHUTDOWN(vp->v_vfsp, SHUTDOWN_DEVICE_REQ, f, l);
71}
72
57struct vnode * 73struct vnode *
58vn_initialize( 74vn_initialize(
59 struct inode *inode) 75 struct inode *inode)
diff --git a/fs/xfs/linux-2.6/xfs_vnode.h b/fs/xfs/linux-2.6/xfs_vnode.h
index 2a8e16c22353..a64b7db67003 100644
--- a/fs/xfs/linux-2.6/xfs_vnode.h
+++ b/fs/xfs/linux-2.6/xfs_vnode.h
@@ -514,6 +514,8 @@ extern void vn_revalidate_core(struct vnode *, vattr_t *);
514extern void vn_iowait(struct vnode *vp); 514extern void vn_iowait(struct vnode *vp);
515extern void vn_iowake(struct vnode *vp); 515extern void vn_iowake(struct vnode *vp);
516 516
517extern void vn_ioerror(struct vnode *vp, int error, char *f, int l);
518
517static inline int vn_count(struct vnode *vp) 519static inline int vn_count(struct vnode *vp)
518{ 520{
519 return atomic_read(&vn_to_inode(vp)->i_count); 521 return atomic_read(&vn_to_inode(vp)->i_count);
diff --git a/fs/xfs/quota/xfs_dquot.c b/fs/xfs/quota/xfs_dquot.c
index 26ee5df4f83d..46bec66bb4d8 100644
--- a/fs/xfs/quota/xfs_dquot.c
+++ b/fs/xfs/quota/xfs_dquot.c
@@ -1261,7 +1261,7 @@ xfs_qm_dqflush(
1261 1261
1262 if (xfs_qm_dqcheck(&dqp->q_core, be32_to_cpu(ddqp->d_id), 1262 if (xfs_qm_dqcheck(&dqp->q_core, be32_to_cpu(ddqp->d_id),
1263 0, XFS_QMOPT_DOWARN, "dqflush (incore copy)")) { 1263 0, XFS_QMOPT_DOWARN, "dqflush (incore copy)")) {
1264 xfs_force_shutdown(dqp->q_mount, XFS_CORRUPT_INCORE); 1264 xfs_force_shutdown(dqp->q_mount, SHUTDOWN_CORRUPT_INCORE);
1265 return XFS_ERROR(EIO); 1265 return XFS_ERROR(EIO);
1266 } 1266 }
1267 1267
diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c
index ad595dbefe16..b4529421823b 100644
--- a/fs/xfs/xfs_bmap.c
+++ b/fs/xfs/xfs_bmap.c
@@ -4263,8 +4263,8 @@ xfs_bmap_finish(
4263 if (!XFS_FORCED_SHUTDOWN(mp)) 4263 if (!XFS_FORCED_SHUTDOWN(mp))
4264 xfs_force_shutdown(mp, 4264 xfs_force_shutdown(mp,
4265 (error == EFSCORRUPTED) ? 4265 (error == EFSCORRUPTED) ?
4266 XFS_CORRUPT_INCORE : 4266 SHUTDOWN_CORRUPT_INCORE :
4267 XFS_METADATA_IO_ERROR); 4267 SHUTDOWN_META_IO_ERROR);
4268 return error; 4268 return error;
4269 } 4269 }
4270 xfs_trans_log_efd_extent(ntp, efd, free->xbfi_startblock, 4270 xfs_trans_log_efd_extent(ntp, efd, free->xbfi_startblock,
diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c
index 5fed15682dda..59013e1f16e5 100644
--- a/fs/xfs/xfs_buf_item.c
+++ b/fs/xfs/xfs_buf_item.c
@@ -1108,7 +1108,7 @@ xfs_buf_error_relse(
1108 XFS_BUF_ERROR(bp,0); 1108 XFS_BUF_ERROR(bp,0);
1109 xfs_buftrace("BUF_ERROR_RELSE", bp); 1109 xfs_buftrace("BUF_ERROR_RELSE", bp);
1110 if (! XFS_FORCED_SHUTDOWN(mp)) 1110 if (! XFS_FORCED_SHUTDOWN(mp))
1111 xfs_force_shutdown(mp, XFS_METADATA_IO_ERROR); 1111 xfs_force_shutdown(mp, SHUTDOWN_META_IO_ERROR);
1112 /* 1112 /*
1113 * We have to unpin the pinned buffers so do the 1113 * We have to unpin the pinned buffers so do the
1114 * callbacks. 1114 * callbacks.
diff --git a/fs/xfs/xfs_fsops.c b/fs/xfs/xfs_fsops.c
index dfa3527b20a7..96f4b3e8fa4a 100644
--- a/fs/xfs/xfs_fsops.c
+++ b/fs/xfs/xfs_fsops.c
@@ -578,17 +578,18 @@ xfs_fs_goingdown(
578 struct super_block *sb = freeze_bdev(vfsp->vfs_super->s_bdev); 578 struct super_block *sb = freeze_bdev(vfsp->vfs_super->s_bdev);
579 579
580 if (sb && !IS_ERR(sb)) { 580 if (sb && !IS_ERR(sb)) {
581 xfs_force_shutdown(mp, XFS_FORCE_UMOUNT); 581 xfs_force_shutdown(mp, SHUTDOWN_FORCE_UMOUNT);
582 thaw_bdev(sb->s_bdev, sb); 582 thaw_bdev(sb->s_bdev, sb);
583 } 583 }
584 584
585 break; 585 break;
586 } 586 }
587 case XFS_FSOP_GOING_FLAGS_LOGFLUSH: 587 case XFS_FSOP_GOING_FLAGS_LOGFLUSH:
588 xfs_force_shutdown(mp, XFS_FORCE_UMOUNT); 588 xfs_force_shutdown(mp, SHUTDOWN_FORCE_UMOUNT);
589 break; 589 break;
590 case XFS_FSOP_GOING_FLAGS_NOLOGFLUSH: 590 case XFS_FSOP_GOING_FLAGS_NOLOGFLUSH:
591 xfs_force_shutdown(mp, XFS_FORCE_UMOUNT|XFS_LOG_IO_ERROR); 591 xfs_force_shutdown(mp,
592 SHUTDOWN_FORCE_UMOUNT | SHUTDOWN_LOG_IO_ERROR);
592 break; 593 break;
593 default: 594 default:
594 return XFS_ERROR(EINVAL); 595 return XFS_ERROR(EINVAL);
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index df695e968066..b30bffa99edc 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -3206,7 +3206,7 @@ xfs_iflush(
3206 3206
3207corrupt_out: 3207corrupt_out:
3208 xfs_buf_relse(bp); 3208 xfs_buf_relse(bp);
3209 xfs_force_shutdown(mp, XFS_CORRUPT_INCORE); 3209 xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE);
3210 xfs_iflush_abort(ip); 3210 xfs_iflush_abort(ip);
3211 /* 3211 /*
3212 * Unlocks the flush lock 3212 * Unlocks the flush lock
@@ -3228,7 +3228,7 @@ cluster_corrupt_out:
3228 xfs_buf_relse(bp); 3228 xfs_buf_relse(bp);
3229 } 3229 }
3230 3230
3231 xfs_force_shutdown(mp, XFS_CORRUPT_INCORE); 3231 xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE);
3232 3232
3233 if(!bufwasdelwri) { 3233 if(!bufwasdelwri) {
3234 /* 3234 /*
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
index 32e841d2f26d..7d882d6c7d49 100644
--- a/fs/xfs/xfs_log.c
+++ b/fs/xfs/xfs_log.c
@@ -402,7 +402,7 @@ xfs_log_release_iclog(xfs_mount_t *mp,
402 xlog_in_core_t *iclog = (xlog_in_core_t *)iclog_hndl; 402 xlog_in_core_t *iclog = (xlog_in_core_t *)iclog_hndl;
403 403
404 if (xlog_state_release_iclog(log, iclog)) { 404 if (xlog_state_release_iclog(log, iclog)) {
405 xfs_force_shutdown(mp, XFS_LOG_IO_ERROR); 405 xfs_force_shutdown(mp, SHUTDOWN_LOG_IO_ERROR);
406 return EIO; 406 return EIO;
407 } 407 }
408 408
@@ -726,7 +726,7 @@ xfs_log_write(xfs_mount_t * mp,
726 return XFS_ERROR(EIO); 726 return XFS_ERROR(EIO);
727 727
728 if ((error = xlog_write(mp, reg, nentries, tic, start_lsn, NULL, 0))) { 728 if ((error = xlog_write(mp, reg, nentries, tic, start_lsn, NULL, 0))) {
729 xfs_force_shutdown(mp, XFS_LOG_IO_ERROR); 729 xfs_force_shutdown(mp, SHUTDOWN_LOG_IO_ERROR);
730 } 730 }
731 return error; 731 return error;
732} /* xfs_log_write */ 732} /* xfs_log_write */
@@ -956,7 +956,7 @@ xlog_iodone(xfs_buf_t *bp)
956 XFS_ERRTAG_IODONE_IOERR, XFS_RANDOM_IODONE_IOERR)) { 956 XFS_ERRTAG_IODONE_IOERR, XFS_RANDOM_IODONE_IOERR)) {
957 xfs_ioerror_alert("xlog_iodone", l->l_mp, bp, XFS_BUF_ADDR(bp)); 957 xfs_ioerror_alert("xlog_iodone", l->l_mp, bp, XFS_BUF_ADDR(bp));
958 XFS_BUF_STALE(bp); 958 XFS_BUF_STALE(bp);
959 xfs_force_shutdown(l->l_mp, XFS_LOG_IO_ERROR); 959 xfs_force_shutdown(l->l_mp, SHUTDOWN_LOG_IO_ERROR);
960 /* 960 /*
961 * This flag will be propagated to the trans-committed 961 * This flag will be propagated to the trans-committed
962 * callback routines to let them know that the log-commit 962 * callback routines to let them know that the log-commit
@@ -1261,7 +1261,7 @@ xlog_commit_record(xfs_mount_t *mp,
1261 ASSERT_ALWAYS(iclog); 1261 ASSERT_ALWAYS(iclog);
1262 if ((error = xlog_write(mp, reg, 1, ticket, commitlsnp, 1262 if ((error = xlog_write(mp, reg, 1, ticket, commitlsnp,
1263 iclog, XLOG_COMMIT_TRANS))) { 1263 iclog, XLOG_COMMIT_TRANS))) {
1264 xfs_force_shutdown(mp, XFS_LOG_IO_ERROR); 1264 xfs_force_shutdown(mp, SHUTDOWN_LOG_IO_ERROR);
1265 } 1265 }
1266 return error; 1266 return error;
1267} /* xlog_commit_record */ 1267} /* xlog_commit_record */
@@ -1790,7 +1790,7 @@ xlog_write(xfs_mount_t * mp,
1790 xfs_cmn_err(XFS_PTAG_LOGRES, CE_ALERT, mp, 1790 xfs_cmn_err(XFS_PTAG_LOGRES, CE_ALERT, mp,
1791 "xfs_log_write: reservation ran out. Need to up reservation"); 1791 "xfs_log_write: reservation ran out. Need to up reservation");
1792 /* If we did not panic, shutdown the filesystem */ 1792 /* If we did not panic, shutdown the filesystem */
1793 xfs_force_shutdown(mp, XFS_CORRUPT_INCORE); 1793 xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE);
1794#endif 1794#endif
1795 } else 1795 } else
1796 ticket->t_curr_res -= len; 1796 ticket->t_curr_res -= len;
diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
index 3abc98944c04..a17218e81536 100644
--- a/fs/xfs/xfs_log_recover.c
+++ b/fs/xfs/xfs_log_recover.c
@@ -282,7 +282,7 @@ xlog_recover_iodone(
282 mp = XFS_BUF_FSPRIVATE(bp, xfs_mount_t *); 282 mp = XFS_BUF_FSPRIVATE(bp, xfs_mount_t *);
283 xfs_ioerror_alert("xlog_recover_iodone", 283 xfs_ioerror_alert("xlog_recover_iodone",
284 mp, bp, XFS_BUF_ADDR(bp)); 284 mp, bp, XFS_BUF_ADDR(bp));
285 xfs_force_shutdown(mp, XFS_METADATA_IO_ERROR); 285 xfs_force_shutdown(mp, SHUTDOWN_META_IO_ERROR);
286 } 286 }
287 XFS_BUF_SET_FSPRIVATE(bp, NULL); 287 XFS_BUF_SET_FSPRIVATE(bp, NULL);
288 XFS_BUF_CLR_IODONE_FUNC(bp); 288 XFS_BUF_CLR_IODONE_FUNC(bp);
diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h
index a682eb558102..2ca211214a9c 100644
--- a/fs/xfs/xfs_mount.h
+++ b/fs/xfs/xfs_mount.h
@@ -514,15 +514,6 @@ xfs_preferred_iosize(xfs_mount_t *mp)
514 VFS_FORCE_SHUTDOWN((XFS_MTOVFS(m)), f, __FILE__, __LINE__) 514 VFS_FORCE_SHUTDOWN((XFS_MTOVFS(m)), f, __FILE__, __LINE__)
515 515
516/* 516/*
517 * Flags sent to xfs_force_shutdown.
518 */
519#define XFS_METADATA_IO_ERROR 0x1
520#define XFS_LOG_IO_ERROR 0x2
521#define XFS_FORCE_UMOUNT 0x4
522#define XFS_CORRUPT_INCORE 0x8 /* Corrupt in-memory data structures */
523#define XFS_SHUTDOWN_REMOTE_REQ 0x10 /* Shutdown came from remote cell */
524
525/*
526 * Flags for xfs_mountfs 517 * Flags for xfs_mountfs
527 */ 518 */
528#define XFS_MFSI_SECOND 0x01 /* Secondary mount -- skip stuff */ 519#define XFS_MFSI_SECOND 0x01 /* Secondary mount -- skip stuff */
diff --git a/fs/xfs/xfs_rw.c b/fs/xfs/xfs_rw.c
index a59c102cf214..d33e4f5808e5 100644
--- a/fs/xfs/xfs_rw.c
+++ b/fs/xfs/xfs_rw.c
@@ -109,12 +109,12 @@ xfs_do_force_shutdown(
109 xfs_mount_t *mp; 109 xfs_mount_t *mp;
110 110
111 mp = XFS_BHVTOM(bdp); 111 mp = XFS_BHVTOM(bdp);
112 logerror = flags & XFS_LOG_IO_ERROR; 112 logerror = flags & SHUTDOWN_LOG_IO_ERROR;
113 113
114 if (!(flags & XFS_FORCE_UMOUNT)) { 114 if (!(flags & SHUTDOWN_FORCE_UMOUNT)) {
115 cmn_err(CE_NOTE, 115 cmn_err(CE_NOTE, "xfs_force_shutdown(%s,0x%x) called from "
116 "xfs_force_shutdown(%s,0x%x) called from line %d of file %s. Return address = 0x%p", 116 "line %d of file %s. Return address = 0x%p",
117 mp->m_fsname,flags,lnnum,fname,__return_address); 117 mp->m_fsname, flags, lnnum, fname, __return_address);
118 } 118 }
119 /* 119 /*
120 * No need to duplicate efforts. 120 * No need to duplicate efforts.
@@ -125,33 +125,37 @@ xfs_do_force_shutdown(
125 /* 125 /*
126 * This flags XFS_MOUNT_FS_SHUTDOWN, makes sure that we don't 126 * This flags XFS_MOUNT_FS_SHUTDOWN, makes sure that we don't
127 * queue up anybody new on the log reservations, and wakes up 127 * queue up anybody new on the log reservations, and wakes up
128 * everybody who's sleeping on log reservations and tells 128 * everybody who's sleeping on log reservations to tell them
129 * them the bad news. 129 * the bad news.
130 */ 130 */
131 if (xfs_log_force_umount(mp, logerror)) 131 if (xfs_log_force_umount(mp, logerror))
132 return; 132 return;
133 133
134 if (flags & XFS_CORRUPT_INCORE) { 134 if (flags & SHUTDOWN_CORRUPT_INCORE) {
135 xfs_cmn_err(XFS_PTAG_SHUTDOWN_CORRUPT, CE_ALERT, mp, 135 xfs_cmn_err(XFS_PTAG_SHUTDOWN_CORRUPT, CE_ALERT, mp,
136 "Corruption of in-memory data detected. Shutting down filesystem: %s", 136 "Corruption of in-memory data detected. Shutting down filesystem: %s",
137 mp->m_fsname); 137 mp->m_fsname);
138 if (XFS_ERRLEVEL_HIGH <= xfs_error_level) { 138 if (XFS_ERRLEVEL_HIGH <= xfs_error_level) {
139 xfs_stack_trace(); 139 xfs_stack_trace();
140 } 140 }
141 } else if (!(flags & XFS_FORCE_UMOUNT)) { 141 } else if (!(flags & SHUTDOWN_FORCE_UMOUNT)) {
142 if (logerror) { 142 if (logerror) {
143 xfs_cmn_err(XFS_PTAG_SHUTDOWN_LOGERROR, CE_ALERT, mp, 143 xfs_cmn_err(XFS_PTAG_SHUTDOWN_LOGERROR, CE_ALERT, mp,
144 "Log I/O Error Detected. Shutting down filesystem: %s", 144 "Log I/O Error Detected. Shutting down filesystem: %s",
145 mp->m_fsname); 145 mp->m_fsname);
146 } else if (!(flags & XFS_SHUTDOWN_REMOTE_REQ)) { 146 } else if (flags & SHUTDOWN_DEVICE_REQ) {
147 xfs_cmn_err(XFS_PTAG_SHUTDOWN_IOERROR, CE_ALERT, mp, 147 xfs_cmn_err(XFS_PTAG_SHUTDOWN_IOERROR, CE_ALERT, mp,
148 "I/O Error Detected. Shutting down filesystem: %s", 148 "All device paths lost. Shutting down filesystem: %s",
149 mp->m_fsname);
150 } else if (!(flags & SHUTDOWN_REMOTE_REQ)) {
151 xfs_cmn_err(XFS_PTAG_SHUTDOWN_IOERROR, CE_ALERT, mp,
152 "I/O Error Detected. Shutting down filesystem: %s",
149 mp->m_fsname); 153 mp->m_fsname);
150 } 154 }
151 } 155 }
152 if (!(flags & XFS_FORCE_UMOUNT)) { 156 if (!(flags & SHUTDOWN_FORCE_UMOUNT)) {
153 cmn_err(CE_ALERT, 157 cmn_err(CE_ALERT, "Please umount the filesystem, "
154 "Please umount the filesystem, and rectify the problem(s)"); 158 "and rectify the problem(s)");
155 } 159 }
156} 160}
157 161
@@ -335,7 +339,7 @@ xfs_bwrite(
335 * from bwrite and we could be tracing a buffer that has 339 * from bwrite and we could be tracing a buffer that has
336 * been reused. 340 * been reused.
337 */ 341 */
338 xfs_force_shutdown(mp, XFS_METADATA_IO_ERROR); 342 xfs_force_shutdown(mp, SHUTDOWN_META_IO_ERROR);
339 } 343 }
340 return (error); 344 return (error);
341} 345}
diff --git a/fs/xfs/xfs_trans.c b/fs/xfs/xfs_trans.c
index 8d056cef5d1f..c05da5871a51 100644
--- a/fs/xfs/xfs_trans.c
+++ b/fs/xfs/xfs_trans.c
@@ -846,7 +846,7 @@ shut_us_down:
846 */ 846 */
847 nvec = xfs_trans_count_vecs(tp); 847 nvec = xfs_trans_count_vecs(tp);
848 if (nvec == 0) { 848 if (nvec == 0) {
849 xfs_force_shutdown(mp, XFS_LOG_IO_ERROR); 849 xfs_force_shutdown(mp, SHUTDOWN_LOG_IO_ERROR);
850 goto shut_us_down; 850 goto shut_us_down;
851 } else if (nvec <= XFS_TRANS_LOGVEC_COUNT) { 851 } else if (nvec <= XFS_TRANS_LOGVEC_COUNT) {
852 log_vector = log_vector_fast; 852 log_vector = log_vector_fast;
@@ -1148,7 +1148,7 @@ xfs_trans_cancel(
1148 */ 1148 */
1149 if ((tp->t_flags & XFS_TRANS_DIRTY) && !XFS_FORCED_SHUTDOWN(mp)) { 1149 if ((tp->t_flags & XFS_TRANS_DIRTY) && !XFS_FORCED_SHUTDOWN(mp)) {
1150 XFS_ERROR_REPORT("xfs_trans_cancel", XFS_ERRLEVEL_LOW, mp); 1150 XFS_ERROR_REPORT("xfs_trans_cancel", XFS_ERRLEVEL_LOW, mp);
1151 xfs_force_shutdown(mp, XFS_CORRUPT_INCORE); 1151 xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE);
1152 } 1152 }
1153#ifdef DEBUG 1153#ifdef DEBUG
1154 if (!(flags & XFS_TRANS_ABORT)) { 1154 if (!(flags & XFS_TRANS_ABORT)) {
diff --git a/fs/xfs/xfs_trans_ail.c b/fs/xfs/xfs_trans_ail.c
index 19ab24af1c1c..e1ca7b6fde42 100644
--- a/fs/xfs/xfs_trans_ail.c
+++ b/fs/xfs/xfs_trans_ail.c
@@ -363,9 +363,10 @@ xfs_trans_delete_ail(
363 AIL_UNLOCK(mp, s); 363 AIL_UNLOCK(mp, s);
364 else { 364 else {
365 xfs_cmn_err(XFS_PTAG_AILDELETE, CE_ALERT, mp, 365 xfs_cmn_err(XFS_PTAG_AILDELETE, CE_ALERT, mp,
366 "xfs_trans_delete_ail: attempting to delete a log item that is not in the AIL"); 366 "%s: attempting to delete a log item that is not in the AIL",
367 __FUNCTION__);
367 AIL_UNLOCK(mp, s); 368 AIL_UNLOCK(mp, s);
368 xfs_force_shutdown(mp, XFS_CORRUPT_INCORE); 369 xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE);
369 } 370 }
370 } 371 }
371} 372}
diff --git a/fs/xfs/xfs_trans_buf.c b/fs/xfs/xfs_trans_buf.c
index c74c31ebc81c..422913645709 100644
--- a/fs/xfs/xfs_trans_buf.c
+++ b/fs/xfs/xfs_trans_buf.c
@@ -369,7 +369,7 @@ xfs_trans_read_buf(
369 */ 369 */
370 if (tp->t_flags & XFS_TRANS_DIRTY) 370 if (tp->t_flags & XFS_TRANS_DIRTY)
371 xfs_force_shutdown(tp->t_mountp, 371 xfs_force_shutdown(tp->t_mountp,
372 XFS_METADATA_IO_ERROR); 372 SHUTDOWN_META_IO_ERROR);
373 return error; 373 return error;
374 } 374 }
375 } 375 }
@@ -414,7 +414,7 @@ xfs_trans_read_buf(
414 xfs_ioerror_alert("xfs_trans_read_buf", mp, 414 xfs_ioerror_alert("xfs_trans_read_buf", mp,
415 bp, blkno); 415 bp, blkno);
416 if (tp->t_flags & XFS_TRANS_DIRTY) 416 if (tp->t_flags & XFS_TRANS_DIRTY)
417 xfs_force_shutdown(tp->t_mountp, XFS_METADATA_IO_ERROR); 417 xfs_force_shutdown(tp->t_mountp, SHUTDOWN_META_IO_ERROR);
418 xfs_buf_relse(bp); 418 xfs_buf_relse(bp);
419 return error; 419 return error;
420 } 420 }
@@ -423,7 +423,7 @@ xfs_trans_read_buf(
423 if (xfs_error_target == target) { 423 if (xfs_error_target == target) {
424 if (((xfs_req_num++) % xfs_error_mod) == 0) { 424 if (((xfs_req_num++) % xfs_error_mod) == 0) {
425 xfs_force_shutdown(tp->t_mountp, 425 xfs_force_shutdown(tp->t_mountp,
426 XFS_METADATA_IO_ERROR); 426 SHUTDOWN_META_IO_ERROR);
427 xfs_buf_relse(bp); 427 xfs_buf_relse(bp);
428 printk("Returning error in trans!\n"); 428 printk("Returning error in trans!\n");
429 return XFS_ERROR(EIO); 429 return XFS_ERROR(EIO);
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c
index d1c6349e4018..cb36a56392e7 100644
--- a/fs/xfs/xfs_vnodeops.c
+++ b/fs/xfs/xfs_vnodeops.c
@@ -1761,7 +1761,7 @@ xfs_inactive(
1761 cmn_err(CE_NOTE, 1761 cmn_err(CE_NOTE,
1762 "xfs_inactive: xfs_ifree() returned an error = %d on %s", 1762 "xfs_inactive: xfs_ifree() returned an error = %d on %s",
1763 error, mp->m_fsname); 1763 error, mp->m_fsname);
1764 xfs_force_shutdown(mp, XFS_METADATA_IO_ERROR); 1764 xfs_force_shutdown(mp, SHUTDOWN_META_IO_ERROR);
1765 } 1765 }
1766 xfs_trans_cancel(tp, XFS_TRANS_RELEASE_LOG_RES|XFS_TRANS_ABORT); 1766 xfs_trans_cancel(tp, XFS_TRANS_RELEASE_LOG_RES|XFS_TRANS_ABORT);
1767 } else { 1767 } else {