diff options
author | David S. Miller <davem@davemloft.net> | 2010-01-23 03:31:06 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-01-23 03:31:06 -0500 |
commit | 51c24aaacaea90c8e87f1dec75a2ac7622b593f8 (patch) | |
tree | 9f54936c87764bef75e97395cb56b7d1e0df24c6 /fs/jbd2/checkpoint.c | |
parent | 4276e47e2d1c85a2477caf0d22b91c4f2377fba8 (diff) | |
parent | 6be325719b3e54624397e413efd4b33a997e55a3 (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Diffstat (limited to 'fs/jbd2/checkpoint.c')
-rw-r--r-- | fs/jbd2/checkpoint.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/fs/jbd2/checkpoint.c b/fs/jbd2/checkpoint.c index ca0f5eb62b20..886849370950 100644 --- a/fs/jbd2/checkpoint.c +++ b/fs/jbd2/checkpoint.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/jbd2.h> | 22 | #include <linux/jbd2.h> |
23 | #include <linux/errno.h> | 23 | #include <linux/errno.h> |
24 | #include <linux/slab.h> | 24 | #include <linux/slab.h> |
25 | #include <linux/blkdev.h> | ||
25 | #include <trace/events/jbd2.h> | 26 | #include <trace/events/jbd2.h> |
26 | 27 | ||
27 | /* | 28 | /* |
@@ -515,6 +516,20 @@ int jbd2_cleanup_journal_tail(journal_t *journal) | |||
515 | journal->j_tail_sequence = first_tid; | 516 | journal->j_tail_sequence = first_tid; |
516 | journal->j_tail = blocknr; | 517 | journal->j_tail = blocknr; |
517 | spin_unlock(&journal->j_state_lock); | 518 | spin_unlock(&journal->j_state_lock); |
519 | |||
520 | /* | ||
521 | * If there is an external journal, we need to make sure that | ||
522 | * any data blocks that were recently written out --- perhaps | ||
523 | * by jbd2_log_do_checkpoint() --- are flushed out before we | ||
524 | * drop the transactions from the external journal. It's | ||
525 | * unlikely this will be necessary, especially with a | ||
526 | * appropriately sized journal, but we need this to guarantee | ||
527 | * correctness. Fortunately jbd2_cleanup_journal_tail() | ||
528 | * doesn't get called all that often. | ||
529 | */ | ||
530 | if ((journal->j_fs_dev != journal->j_dev) && | ||
531 | (journal->j_flags & JBD2_BARRIER)) | ||
532 | blkdev_issue_flush(journal->j_fs_dev, NULL); | ||
518 | if (!(journal->j_flags & JBD2_ABORT)) | 533 | if (!(journal->j_flags & JBD2_ABORT)) |
519 | jbd2_journal_update_superblock(journal, 1); | 534 | jbd2_journal_update_superblock(journal, 1); |
520 | return 0; | 535 | return 0; |