diff options
author | David Chinner <dgc@sgi.com> | 2008-04-09 22:21:18 -0400 |
---|---|---|
committer | Lachlan McIlroy <lachlan@redback.melbourne.sgi.com> | 2008-04-17 21:58:17 -0400 |
commit | e5720eec0548c08943d759e39db0388d8fe59287 (patch) | |
tree | e38b474f0dbac30aee7141878953223a2a588c69 /fs/xfs/xfs_vnodeops.c | |
parent | 3c1e2bbe5bcdcd435510a05eb121fa74b848e24f (diff) |
[XFS] Propagate errors from xfs_trans_commit().
xfs_trans_commit() can return errors when there are problems in the
transaction subsystem. They are indicative that the entire transaction may
be incomplete, and hence the error should be propagated as there is a good
possibility that there is something fatally wrong in the filesystem. Catch
and propagate or warn about commit errors in the places where they are
currently ignored.
SGI-PV: 980084
SGI-Modid: xfs-linux-melb:xfs-kern:30795a
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/xfs_vnodeops.c')
-rw-r--r-- | fs/xfs/xfs_vnodeops.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c index d46f24c68498..bc0a4707189a 100644 --- a/fs/xfs/xfs_vnodeops.c +++ b/fs/xfs/xfs_vnodeops.c | |||
@@ -1447,28 +1447,22 @@ xfs_inactive_attrs( | |||
1447 | tp = *tpp; | 1447 | tp = *tpp; |
1448 | mp = ip->i_mount; | 1448 | mp = ip->i_mount; |
1449 | ASSERT(ip->i_d.di_forkoff != 0); | 1449 | ASSERT(ip->i_d.di_forkoff != 0); |
1450 | xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES); | 1450 | error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES); |
1451 | xfs_iunlock(ip, XFS_ILOCK_EXCL); | 1451 | xfs_iunlock(ip, XFS_ILOCK_EXCL); |
1452 | if (error) | ||
1453 | goto error_unlock; | ||
1452 | 1454 | ||
1453 | error = xfs_attr_inactive(ip); | 1455 | error = xfs_attr_inactive(ip); |
1454 | if (error) { | 1456 | if (error) |
1455 | *tpp = NULL; | 1457 | goto error_unlock; |
1456 | xfs_iunlock(ip, XFS_IOLOCK_EXCL); | ||
1457 | return error; /* goto out */ | ||
1458 | } | ||
1459 | 1458 | ||
1460 | tp = xfs_trans_alloc(mp, XFS_TRANS_INACTIVE); | 1459 | tp = xfs_trans_alloc(mp, XFS_TRANS_INACTIVE); |
1461 | error = xfs_trans_reserve(tp, 0, | 1460 | error = xfs_trans_reserve(tp, 0, |
1462 | XFS_IFREE_LOG_RES(mp), | 1461 | XFS_IFREE_LOG_RES(mp), |
1463 | 0, XFS_TRANS_PERM_LOG_RES, | 1462 | 0, XFS_TRANS_PERM_LOG_RES, |
1464 | XFS_INACTIVE_LOG_COUNT); | 1463 | XFS_INACTIVE_LOG_COUNT); |
1465 | if (error) { | 1464 | if (error) |
1466 | ASSERT(XFS_FORCED_SHUTDOWN(mp)); | 1465 | goto error_cancel; |
1467 | xfs_trans_cancel(tp, 0); | ||
1468 | *tpp = NULL; | ||
1469 | xfs_iunlock(ip, XFS_IOLOCK_EXCL); | ||
1470 | return error; | ||
1471 | } | ||
1472 | 1466 | ||
1473 | xfs_ilock(ip, XFS_ILOCK_EXCL); | 1467 | xfs_ilock(ip, XFS_ILOCK_EXCL); |
1474 | xfs_trans_ijoin(tp, ip, XFS_IOLOCK_EXCL | XFS_ILOCK_EXCL); | 1468 | xfs_trans_ijoin(tp, ip, XFS_IOLOCK_EXCL | XFS_ILOCK_EXCL); |
@@ -1479,6 +1473,14 @@ xfs_inactive_attrs( | |||
1479 | 1473 | ||
1480 | *tpp = tp; | 1474 | *tpp = tp; |
1481 | return 0; | 1475 | return 0; |
1476 | |||
1477 | error_cancel: | ||
1478 | ASSERT(XFS_FORCED_SHUTDOWN(mp)); | ||
1479 | xfs_trans_cancel(tp, 0); | ||
1480 | error_unlock: | ||
1481 | *tpp = NULL; | ||
1482 | xfs_iunlock(ip, XFS_IOLOCK_EXCL); | ||
1483 | return error; | ||
1482 | } | 1484 | } |
1483 | 1485 | ||
1484 | int | 1486 | int |