diff options
Diffstat (limited to 'fs/reiserfs/journal.c')
-rw-r--r-- | fs/reiserfs/journal.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/fs/reiserfs/journal.c b/fs/reiserfs/journal.c index 68b7b78638ff..3f17ef844fb6 100644 --- a/fs/reiserfs/journal.c +++ b/fs/reiserfs/journal.c | |||
@@ -1039,6 +1039,10 @@ static int flush_commit_list(struct super_block *s, | |||
1039 | } | 1039 | } |
1040 | atomic_dec(&journal->j_async_throttle); | 1040 | atomic_dec(&journal->j_async_throttle); |
1041 | 1041 | ||
1042 | /* We're skipping the commit if there's an error */ | ||
1043 | if (retval || reiserfs_is_journal_aborted(journal)) | ||
1044 | barrier = 0; | ||
1045 | |||
1042 | /* wait on everything written so far before writing the commit | 1046 | /* wait on everything written so far before writing the commit |
1043 | * if we are in barrier mode, send the commit down now | 1047 | * if we are in barrier mode, send the commit down now |
1044 | */ | 1048 | */ |
@@ -1077,10 +1081,16 @@ static int flush_commit_list(struct super_block *s, | |||
1077 | BUG_ON(atomic_read(&(jl->j_commit_left)) != 1); | 1081 | BUG_ON(atomic_read(&(jl->j_commit_left)) != 1); |
1078 | 1082 | ||
1079 | if (!barrier) { | 1083 | if (!barrier) { |
1080 | if (buffer_dirty(jl->j_commit_bh)) | 1084 | /* If there was a write error in the journal - we can't commit |
1081 | BUG(); | 1085 | * this transaction - it will be invalid and, if successful, |
1082 | mark_buffer_dirty(jl->j_commit_bh); | 1086 | * will just end up propogating the write error out to |
1083 | sync_dirty_buffer(jl->j_commit_bh); | 1087 | * the file system. */ |
1088 | if (likely(!retval && !reiserfs_is_journal_aborted (journal))) { | ||
1089 | if (buffer_dirty(jl->j_commit_bh)) | ||
1090 | BUG(); | ||
1091 | mark_buffer_dirty(jl->j_commit_bh) ; | ||
1092 | sync_dirty_buffer(jl->j_commit_bh) ; | ||
1093 | } | ||
1084 | } else | 1094 | } else |
1085 | wait_on_buffer(jl->j_commit_bh); | 1095 | wait_on_buffer(jl->j_commit_bh); |
1086 | 1096 | ||