diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-24 18:11:46 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-24 18:11:46 -0400 |
commit | dc522adbee91dd17fa31f8e8cf72673fe0e8370e (patch) | |
tree | 3bef22735e85c680c8049b2145ecbeb332f3f59b /fs/jbd | |
parent | df3256f9ab7ae2127144de5ba2abca332278a42d (diff) | |
parent | c2b67735e5d3a419e90047b3f4179e54a39637bc (diff) |
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs-2.6
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs-2.6:
jbd: Fix comment to match the code in journal_start()
jbd/jbd2: remove obsolete summarise_journal_usage.
jbd: Fix forever sleeping process in do_get_write_access()
ext2: fix error msg when mounting fs with too-large blocksize
jbd: fix fsync() tid wraparound bug
ext3: Fix fs corruption when make_indexed_dir() fails
ext3: Fix lock inversion in ext3_symlink()
Diffstat (limited to 'fs/jbd')
-rw-r--r-- | fs/jbd/commit.c | 15 | ||||
-rw-r--r-- | fs/jbd/journal.c | 16 | ||||
-rw-r--r-- | fs/jbd/transaction.c | 3 |
3 files changed, 22 insertions, 12 deletions
diff --git a/fs/jbd/commit.c b/fs/jbd/commit.c index 69b180459463..72ffa974b0b8 100644 --- a/fs/jbd/commit.c +++ b/fs/jbd/commit.c | |||
@@ -302,12 +302,6 @@ void journal_commit_transaction(journal_t *journal) | |||
302 | * all outstanding updates to complete. | 302 | * all outstanding updates to complete. |
303 | */ | 303 | */ |
304 | 304 | ||
305 | #ifdef COMMIT_STATS | ||
306 | spin_lock(&journal->j_list_lock); | ||
307 | summarise_journal_usage(journal); | ||
308 | spin_unlock(&journal->j_list_lock); | ||
309 | #endif | ||
310 | |||
311 | /* Do we need to erase the effects of a prior journal_flush? */ | 305 | /* Do we need to erase the effects of a prior journal_flush? */ |
312 | if (journal->j_flags & JFS_FLUSHED) { | 306 | if (journal->j_flags & JFS_FLUSHED) { |
313 | jbd_debug(3, "super block updated\n"); | 307 | jbd_debug(3, "super block updated\n"); |
@@ -722,8 +716,13 @@ wait_for_iobuf: | |||
722 | required. */ | 716 | required. */ |
723 | JBUFFER_TRACE(jh, "file as BJ_Forget"); | 717 | JBUFFER_TRACE(jh, "file as BJ_Forget"); |
724 | journal_file_buffer(jh, commit_transaction, BJ_Forget); | 718 | journal_file_buffer(jh, commit_transaction, BJ_Forget); |
725 | /* Wake up any transactions which were waiting for this | 719 | /* |
726 | IO to complete */ | 720 | * Wake up any transactions which were waiting for this |
721 | * IO to complete. The barrier must be here so that changes | ||
722 | * by journal_file_buffer() take effect before wake_up_bit() | ||
723 | * does the waitqueue check. | ||
724 | */ | ||
725 | smp_mb(); | ||
727 | wake_up_bit(&bh->b_state, BH_Unshadow); | 726 | wake_up_bit(&bh->b_state, BH_Unshadow); |
728 | JBUFFER_TRACE(jh, "brelse shadowed buffer"); | 727 | JBUFFER_TRACE(jh, "brelse shadowed buffer"); |
729 | __brelse(bh); | 728 | __brelse(bh); |
diff --git a/fs/jbd/journal.c b/fs/jbd/journal.c index b3713afaaa9e..e2d4285fbe90 100644 --- a/fs/jbd/journal.c +++ b/fs/jbd/journal.c | |||
@@ -437,9 +437,12 @@ int __log_space_left(journal_t *journal) | |||
437 | int __log_start_commit(journal_t *journal, tid_t target) | 437 | int __log_start_commit(journal_t *journal, tid_t target) |
438 | { | 438 | { |
439 | /* | 439 | /* |
440 | * Are we already doing a recent enough commit? | 440 | * The only transaction we can possibly wait upon is the |
441 | * currently running transaction (if it exists). Otherwise, | ||
442 | * the target tid must be an old one. | ||
441 | */ | 443 | */ |
442 | if (!tid_geq(journal->j_commit_request, target)) { | 444 | if (journal->j_running_transaction && |
445 | journal->j_running_transaction->t_tid == target) { | ||
443 | /* | 446 | /* |
444 | * We want a new commit: OK, mark the request and wakeup the | 447 | * We want a new commit: OK, mark the request and wakeup the |
445 | * commit thread. We do _not_ do the commit ourselves. | 448 | * commit thread. We do _not_ do the commit ourselves. |
@@ -451,7 +454,14 @@ int __log_start_commit(journal_t *journal, tid_t target) | |||
451 | journal->j_commit_sequence); | 454 | journal->j_commit_sequence); |
452 | wake_up(&journal->j_wait_commit); | 455 | wake_up(&journal->j_wait_commit); |
453 | return 1; | 456 | return 1; |
454 | } | 457 | } else if (!tid_geq(journal->j_commit_request, target)) |
458 | /* This should never happen, but if it does, preserve | ||
459 | the evidence before kjournald goes into a loop and | ||
460 | increments j_commit_sequence beyond all recognition. */ | ||
461 | WARN_ONCE(1, "jbd: bad log_start_commit: %u %u %u %u\n", | ||
462 | journal->j_commit_request, journal->j_commit_sequence, | ||
463 | target, journal->j_running_transaction ? | ||
464 | journal->j_running_transaction->t_tid : 0); | ||
455 | return 0; | 465 | return 0; |
456 | } | 466 | } |
457 | 467 | ||
diff --git a/fs/jbd/transaction.c b/fs/jbd/transaction.c index 60d2319651b2..f7ee81a065da 100644 --- a/fs/jbd/transaction.c +++ b/fs/jbd/transaction.c | |||
@@ -266,7 +266,8 @@ static handle_t *new_handle(int nblocks) | |||
266 | * This function is visible to journal users (like ext3fs), so is not | 266 | * This function is visible to journal users (like ext3fs), so is not |
267 | * called with the journal already locked. | 267 | * called with the journal already locked. |
268 | * | 268 | * |
269 | * Return a pointer to a newly allocated handle, or NULL on failure | 269 | * Return a pointer to a newly allocated handle, or an ERR_PTR() value |
270 | * on failure. | ||
270 | */ | 271 | */ |
271 | handle_t *journal_start(journal_t *journal, int nblocks) | 272 | handle_t *journal_start(journal_t *journal, int nblocks) |
272 | { | 273 | { |