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_vfsops.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_vfsops.c')
-rw-r--r-- | fs/xfs/xfs_vfsops.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/fs/xfs/xfs_vfsops.c b/fs/xfs/xfs_vfsops.c index 6351efb569c7..09e186d02c11 100644 --- a/fs/xfs/xfs_vfsops.c +++ b/fs/xfs/xfs_vfsops.c | |||
@@ -672,6 +672,8 @@ void | |||
672 | xfs_attr_quiesce( | 672 | xfs_attr_quiesce( |
673 | xfs_mount_t *mp) | 673 | xfs_mount_t *mp) |
674 | { | 674 | { |
675 | int error = 0; | ||
676 | |||
675 | /* wait for all modifications to complete */ | 677 | /* wait for all modifications to complete */ |
676 | while (atomic_read(&mp->m_active_trans) > 0) | 678 | while (atomic_read(&mp->m_active_trans) > 0) |
677 | delay(100); | 679 | delay(100); |
@@ -682,7 +684,11 @@ xfs_attr_quiesce( | |||
682 | ASSERT_ALWAYS(atomic_read(&mp->m_active_trans) == 0); | 684 | ASSERT_ALWAYS(atomic_read(&mp->m_active_trans) == 0); |
683 | 685 | ||
684 | /* Push the superblock and write an unmount record */ | 686 | /* Push the superblock and write an unmount record */ |
685 | xfs_log_sbcount(mp, 1); | 687 | error = xfs_log_sbcount(mp, 1); |
688 | if (error) | ||
689 | xfs_fs_cmn_err(CE_WARN, mp, | ||
690 | "xfs_attr_quiesce: failed to log sb changes. " | ||
691 | "Frozen image may not be consistent."); | ||
686 | xfs_log_unmount_write(mp); | 692 | xfs_log_unmount_write(mp); |
687 | xfs_unmountfs_writesb(mp); | 693 | xfs_unmountfs_writesb(mp); |
688 | } | 694 | } |
@@ -1316,8 +1322,11 @@ xfs_syncsub( | |||
1316 | * of sync if we crash or get a forced shutdown. We don't want to force | 1322 | * of sync if we crash or get a forced shutdown. We don't want to force |
1317 | * this to disk, just get a transaction into the iclogs.... | 1323 | * this to disk, just get a transaction into the iclogs.... |
1318 | */ | 1324 | */ |
1319 | if (flags & SYNC_SUPER) | 1325 | if (flags & SYNC_SUPER) { |
1320 | xfs_log_sbcount(mp, 0); | 1326 | error = xfs_log_sbcount(mp, 0); |
1327 | if (error) | ||
1328 | last_error = error; | ||
1329 | } | ||
1321 | 1330 | ||
1322 | /* | 1331 | /* |
1323 | * Now check to see if the log needs a "dummy" transaction. | 1332 | * Now check to see if the log needs a "dummy" transaction. |