diff options
author | David Chinner <dgc@sgi.com> | 2008-04-09 22:22:24 -0400 |
---|---|---|
committer | Lachlan McIlroy <lachlan@redback.melbourne.sgi.com> | 2008-04-17 22:00:35 -0400 |
commit | db7a19f2c89d99b66874a7e0c0dc681ff1f37b4e (patch) | |
tree | dd242710a41839617eae7a8b7e71f6effb4d608c /fs/xfs | |
parent | d64e31a2f53cdcb2f95b782196faacb0995ca0c0 (diff) |
[XFS] Ensure xfs_bawrite() errors are checked.
xfs_bawrite() can return immediate error status on async writes. Unlike
xfsbdstrat() we don't ever check the error on the buffer after the call,
so we currently do not catch errors at all here. Ensure we catch and
propagate or warn to the syslog about up-front async write errors.
SGI-PV: 980084
SGI-Modid: xfs-linux-melb:xfs-kern:30824a
Signed-off-by: David Chinner <dgc@sgi.com>
Signed-off-by: Niv Sardi <xaiki@sgi.com>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Diffstat (limited to 'fs/xfs')
-rw-r--r-- | fs/xfs/quota/xfs_dquot.c | 10 | ||||
-rw-r--r-- | fs/xfs/quota/xfs_dquot_item.c | 7 | ||||
-rw-r--r-- | fs/xfs/xfs_buf_item.c | 7 | ||||
-rw-r--r-- | fs/xfs/xfs_inode.c | 2 | ||||
-rw-r--r-- | fs/xfs/xfs_inode_item.c | 8 |
5 files changed, 28 insertions, 6 deletions
diff --git a/fs/xfs/quota/xfs_dquot.c b/fs/xfs/quota/xfs_dquot.c index 15214fbb9aa7..631ebb31b295 100644 --- a/fs/xfs/quota/xfs_dquot.c +++ b/fs/xfs/quota/xfs_dquot.c | |||
@@ -1291,7 +1291,7 @@ xfs_qm_dqflush( | |||
1291 | if (flags & XFS_QMOPT_DELWRI) { | 1291 | if (flags & XFS_QMOPT_DELWRI) { |
1292 | xfs_bdwrite(mp, bp); | 1292 | xfs_bdwrite(mp, bp); |
1293 | } else if (flags & XFS_QMOPT_ASYNC) { | 1293 | } else if (flags & XFS_QMOPT_ASYNC) { |
1294 | xfs_bawrite(mp, bp); | 1294 | error = xfs_bawrite(mp, bp); |
1295 | } else { | 1295 | } else { |
1296 | error = xfs_bwrite(mp, bp); | 1296 | error = xfs_bwrite(mp, bp); |
1297 | } | 1297 | } |
@@ -1582,12 +1582,18 @@ xfs_qm_dqflock_pushbuf_wait( | |||
1582 | XFS_INCORE_TRYLOCK); | 1582 | XFS_INCORE_TRYLOCK); |
1583 | if (bp != NULL) { | 1583 | if (bp != NULL) { |
1584 | if (XFS_BUF_ISDELAYWRITE(bp)) { | 1584 | if (XFS_BUF_ISDELAYWRITE(bp)) { |
1585 | int error; | ||
1585 | if (XFS_BUF_ISPINNED(bp)) { | 1586 | if (XFS_BUF_ISPINNED(bp)) { |
1586 | xfs_log_force(dqp->q_mount, | 1587 | xfs_log_force(dqp->q_mount, |
1587 | (xfs_lsn_t)0, | 1588 | (xfs_lsn_t)0, |
1588 | XFS_LOG_FORCE); | 1589 | XFS_LOG_FORCE); |
1589 | } | 1590 | } |
1590 | xfs_bawrite(dqp->q_mount, bp); | 1591 | error = xfs_bawrite(dqp->q_mount, bp); |
1592 | if (error) | ||
1593 | xfs_fs_cmn_err(CE_WARN, dqp->q_mount, | ||
1594 | "xfs_qm_dqflock_pushbuf_wait: " | ||
1595 | "pushbuf error %d on dqp %p, bp %p", | ||
1596 | error, dqp, bp); | ||
1591 | } else { | 1597 | } else { |
1592 | xfs_buf_relse(bp); | 1598 | xfs_buf_relse(bp); |
1593 | } | 1599 | } |
diff --git a/fs/xfs/quota/xfs_dquot_item.c b/fs/xfs/quota/xfs_dquot_item.c index 3dedce1d9cde..36e05ca78412 100644 --- a/fs/xfs/quota/xfs_dquot_item.c +++ b/fs/xfs/quota/xfs_dquot_item.c | |||
@@ -267,11 +267,16 @@ xfs_qm_dquot_logitem_pushbuf( | |||
267 | XFS_LOG_FORCE); | 267 | XFS_LOG_FORCE); |
268 | } | 268 | } |
269 | if (dopush) { | 269 | if (dopush) { |
270 | int error; | ||
270 | #ifdef XFSRACEDEBUG | 271 | #ifdef XFSRACEDEBUG |
271 | delay_for_intr(); | 272 | delay_for_intr(); |
272 | delay(300); | 273 | delay(300); |
273 | #endif | 274 | #endif |
274 | xfs_bawrite(mp, bp); | 275 | error = xfs_bawrite(mp, bp); |
276 | if (error) | ||
277 | xfs_fs_cmn_err(CE_WARN, mp, | ||
278 | "xfs_qm_dquot_logitem_pushbuf: pushbuf error %d on qip %p, bp %p", | ||
279 | error, qip, bp); | ||
275 | } else { | 280 | } else { |
276 | xfs_buf_relse(bp); | 281 | xfs_buf_relse(bp); |
277 | } | 282 | } |
diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c index 63debd147eb5..53a71c62025d 100644 --- a/fs/xfs/xfs_buf_item.c +++ b/fs/xfs/xfs_buf_item.c | |||
@@ -645,7 +645,12 @@ xfs_buf_item_push( | |||
645 | bp = bip->bli_buf; | 645 | bp = bip->bli_buf; |
646 | 646 | ||
647 | if (XFS_BUF_ISDELAYWRITE(bp)) { | 647 | if (XFS_BUF_ISDELAYWRITE(bp)) { |
648 | xfs_bawrite(bip->bli_item.li_mountp, bp); | 648 | int error; |
649 | error = xfs_bawrite(bip->bli_item.li_mountp, bp); | ||
650 | if (error) | ||
651 | xfs_fs_cmn_err(CE_WARN, bip->bli_item.li_mountp, | ||
652 | "xfs_buf_item_push: pushbuf error %d on bip %p, bp %p", | ||
653 | error, bip, bp); | ||
649 | } else { | 654 | } else { |
650 | xfs_buf_relse(bp); | 655 | xfs_buf_relse(bp); |
651 | } | 656 | } |
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index 63e66890f063..ca074ee01d06 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c | |||
@@ -3276,7 +3276,7 @@ xfs_iflush( | |||
3276 | if (flags & INT_DELWRI) { | 3276 | if (flags & INT_DELWRI) { |
3277 | xfs_bdwrite(mp, bp); | 3277 | xfs_bdwrite(mp, bp); |
3278 | } else if (flags & INT_ASYNC) { | 3278 | } else if (flags & INT_ASYNC) { |
3279 | xfs_bawrite(mp, bp); | 3279 | error = xfs_bawrite(mp, bp); |
3280 | } else { | 3280 | } else { |
3281 | error = xfs_bwrite(mp, bp); | 3281 | error = xfs_bwrite(mp, bp); |
3282 | } | 3282 | } |
diff --git a/fs/xfs/xfs_inode_item.c b/fs/xfs/xfs_inode_item.c index 2c775b4ae9e6..93b5db453ea2 100644 --- a/fs/xfs/xfs_inode_item.c +++ b/fs/xfs/xfs_inode_item.c | |||
@@ -40,6 +40,7 @@ | |||
40 | #include "xfs_btree.h" | 40 | #include "xfs_btree.h" |
41 | #include "xfs_ialloc.h" | 41 | #include "xfs_ialloc.h" |
42 | #include "xfs_rw.h" | 42 | #include "xfs_rw.h" |
43 | #include "xfs_error.h" | ||
43 | 44 | ||
44 | 45 | ||
45 | kmem_zone_t *xfs_ili_zone; /* inode log item zone */ | 46 | kmem_zone_t *xfs_ili_zone; /* inode log item zone */ |
@@ -813,7 +814,12 @@ xfs_inode_item_pushbuf( | |||
813 | XFS_LOG_FORCE); | 814 | XFS_LOG_FORCE); |
814 | } | 815 | } |
815 | if (dopush) { | 816 | if (dopush) { |
816 | xfs_bawrite(mp, bp); | 817 | int error; |
818 | error = xfs_bawrite(mp, bp); | ||
819 | if (error) | ||
820 | xfs_fs_cmn_err(CE_WARN, mp, | ||
821 | "xfs_inode_item_pushbuf: pushbuf error %d on iip %p, bp %p", | ||
822 | error, iip, bp); | ||
817 | } else { | 823 | } else { |
818 | xfs_buf_relse(bp); | 824 | xfs_buf_relse(bp); |
819 | } | 825 | } |