diff options
author | Dave Chinner <dchinner@redhat.com> | 2010-05-17 01:51:59 -0400 |
---|---|---|
committer | Alex Elder <aelder@sgi.com> | 2010-05-24 11:38:14 -0400 |
commit | 9da1ab181ac1790f86528b86ba5876f037e8dcdc (patch) | |
tree | 44aed8ed83c4d8b4480d757d2efb0dde475a6500 | |
parent | 71e330b593905e40d6c5afa824d38ee02d70ce5f (diff) |
xfs: forced unmounts need to push the CIL
If the filesystem is being shut down and the there is no log error,
the current code forces out the current log buffers. This code now needs
to push the CIL before it forces out the log buffers to acheive the same
result.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Alex Elder <aelder@sgi.com>
-rw-r--r-- | fs/xfs/xfs_log.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c index 027ebfe20677..5215abc8023a 100644 --- a/fs/xfs/xfs_log.c +++ b/fs/xfs/xfs_log.c | |||
@@ -3688,6 +3688,11 @@ xlog_state_ioerror( | |||
3688 | * c. nothing new gets queued up after (a) and (b) are done. | 3688 | * c. nothing new gets queued up after (a) and (b) are done. |
3689 | * d. if !logerror, flush the iclogs to disk, then seal them off | 3689 | * d. if !logerror, flush the iclogs to disk, then seal them off |
3690 | * for business. | 3690 | * for business. |
3691 | * | ||
3692 | * Note: for delayed logging the !logerror case needs to flush the regions | ||
3693 | * held in memory out to the iclogs before flushing them to disk. This needs | ||
3694 | * to be done before the log is marked as shutdown, otherwise the flush to the | ||
3695 | * iclogs will fail. | ||
3691 | */ | 3696 | */ |
3692 | int | 3697 | int |
3693 | xfs_log_force_umount( | 3698 | xfs_log_force_umount( |
@@ -3721,6 +3726,16 @@ xfs_log_force_umount( | |||
3721 | return 1; | 3726 | return 1; |
3722 | } | 3727 | } |
3723 | retval = 0; | 3728 | retval = 0; |
3729 | |||
3730 | /* | ||
3731 | * Flush the in memory commit item list before marking the log as | ||
3732 | * being shut down. We need to do it in this order to ensure all the | ||
3733 | * completed transactions are flushed to disk with the xfs_log_force() | ||
3734 | * call below. | ||
3735 | */ | ||
3736 | if (!logerror && (mp->m_flags & XFS_MOUNT_DELAYLOG)) | ||
3737 | xlog_cil_push(log, 1); | ||
3738 | |||
3724 | /* | 3739 | /* |
3725 | * We must hold both the GRANT lock and the LOG lock, | 3740 | * We must hold both the GRANT lock and the LOG lock, |
3726 | * before we mark the filesystem SHUTDOWN and wake | 3741 | * before we mark the filesystem SHUTDOWN and wake |