diff options
| author | Thomas Gleixner <tglx@linutronix.de> | 2010-10-12 11:27:20 -0400 |
|---|---|---|
| committer | Thomas Gleixner <tglx@linutronix.de> | 2010-10-12 11:27:28 -0400 |
| commit | 37eca0d64a2dbeece25969ec0698e1ff72bdcf39 (patch) | |
| tree | 54ba70f0428f586f4fe28d8b429b9f9e0799a17a /fs/jbd2/commit.c | |
| parent | 277b199800ac90811ac86d215063df1984f51619 (diff) | |
| parent | 3c06806e690885ce978ef180c8f8b6f8c17fb4b4 (diff) | |
Merge branch 'linus' into core/locking
Reason: Pull in the semaphore related changes
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'fs/jbd2/commit.c')
| -rw-r--r-- | fs/jbd2/commit.c | 39 |
1 files changed, 15 insertions, 24 deletions
diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c index f52e5e8049f1..7c068c189d80 100644 --- a/fs/jbd2/commit.c +++ b/fs/jbd2/commit.c | |||
| @@ -101,7 +101,6 @@ static int journal_submit_commit_record(journal_t *journal, | |||
| 101 | struct commit_header *tmp; | 101 | struct commit_header *tmp; |
| 102 | struct buffer_head *bh; | 102 | struct buffer_head *bh; |
| 103 | int ret; | 103 | int ret; |
| 104 | int barrier_done = 0; | ||
| 105 | struct timespec now = current_kernel_time(); | 104 | struct timespec now = current_kernel_time(); |
| 106 | 105 | ||
| 107 | if (is_journal_aborted(journal)) | 106 | if (is_journal_aborted(journal)) |
| @@ -136,30 +135,22 @@ static int journal_submit_commit_record(journal_t *journal, | |||
| 136 | if (journal->j_flags & JBD2_BARRIER && | 135 | if (journal->j_flags & JBD2_BARRIER && |
| 137 | !JBD2_HAS_INCOMPAT_FEATURE(journal, | 136 | !JBD2_HAS_INCOMPAT_FEATURE(journal, |
| 138 | JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT)) { | 137 | JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT)) { |
| 139 | set_buffer_ordered(bh); | 138 | ret = submit_bh(WRITE_SYNC_PLUG | WRITE_BARRIER, bh); |
| 140 | barrier_done = 1; | 139 | if (ret == -EOPNOTSUPP) { |
| 141 | } | 140 | printk(KERN_WARNING |
| 142 | ret = submit_bh(WRITE_SYNC_PLUG, bh); | 141 | "JBD2: Disabling barriers on %s, " |
| 143 | if (barrier_done) | 142 | "not supported by device\n", journal->j_devname); |
| 144 | clear_buffer_ordered(bh); | 143 | write_lock(&journal->j_state_lock); |
| 145 | 144 | journal->j_flags &= ~JBD2_BARRIER; | |
| 146 | /* is it possible for another commit to fail at roughly | 145 | write_unlock(&journal->j_state_lock); |
| 147 | * the same time as this one? If so, we don't want to | ||
| 148 | * trust the barrier flag in the super, but instead want | ||
| 149 | * to remember if we sent a barrier request | ||
| 150 | */ | ||
| 151 | if (ret == -EOPNOTSUPP && barrier_done) { | ||
| 152 | printk(KERN_WARNING | ||
| 153 | "JBD2: Disabling barriers on %s, " | ||
| 154 | "not supported by device\n", journal->j_devname); | ||
| 155 | write_lock(&journal->j_state_lock); | ||
| 156 | journal->j_flags &= ~JBD2_BARRIER; | ||
| 157 | write_unlock(&journal->j_state_lock); | ||
| 158 | 146 | ||
| 159 | /* And try again, without the barrier */ | 147 | /* And try again, without the barrier */ |
| 160 | lock_buffer(bh); | 148 | lock_buffer(bh); |
| 161 | set_buffer_uptodate(bh); | 149 | set_buffer_uptodate(bh); |
| 162 | clear_buffer_dirty(bh); | 150 | clear_buffer_dirty(bh); |
| 151 | ret = submit_bh(WRITE_SYNC_PLUG, bh); | ||
| 152 | } | ||
| 153 | } else { | ||
| 163 | ret = submit_bh(WRITE_SYNC_PLUG, bh); | 154 | ret = submit_bh(WRITE_SYNC_PLUG, bh); |
| 164 | } | 155 | } |
| 165 | *cbh = bh; | 156 | *cbh = bh; |
