diff options
-rw-r--r-- | fs/jbd2/commit.c | 3 | ||||
-rw-r--r-- | fs/jbd2/transaction.c | 7 | ||||
-rw-r--r-- | include/linux/jbd2.h | 4 |
3 files changed, 11 insertions, 3 deletions
diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c index 78c299218681..2d5095ecc25f 100644 --- a/fs/jbd2/commit.c +++ b/fs/jbd2/commit.c | |||
@@ -219,7 +219,6 @@ static int journal_submit_data_buffers(journal_t *journal, | |||
219 | ret = err; | 219 | ret = err; |
220 | spin_lock(&journal->j_list_lock); | 220 | spin_lock(&journal->j_list_lock); |
221 | J_ASSERT(jinode->i_transaction == commit_transaction); | 221 | J_ASSERT(jinode->i_transaction == commit_transaction); |
222 | commit_transaction->t_flushed_data_blocks = 1; | ||
223 | clear_bit(__JI_COMMIT_RUNNING, &jinode->i_flags); | 222 | clear_bit(__JI_COMMIT_RUNNING, &jinode->i_flags); |
224 | smp_mb__after_clear_bit(); | 223 | smp_mb__after_clear_bit(); |
225 | wake_up_bit(&jinode->i_flags, __JI_COMMIT_RUNNING); | 224 | wake_up_bit(&jinode->i_flags, __JI_COMMIT_RUNNING); |
@@ -683,7 +682,7 @@ start_journal_io: | |||
683 | * then we must flush the file system device before we issue | 682 | * then we must flush the file system device before we issue |
684 | * the commit record | 683 | * the commit record |
685 | */ | 684 | */ |
686 | if (commit_transaction->t_flushed_data_blocks && | 685 | if (commit_transaction->t_need_data_flush && |
687 | (journal->j_fs_dev != journal->j_dev) && | 686 | (journal->j_fs_dev != journal->j_dev) && |
688 | (journal->j_flags & JBD2_BARRIER)) | 687 | (journal->j_flags & JBD2_BARRIER)) |
689 | blkdev_issue_flush(journal->j_fs_dev, GFP_KERNEL, NULL); | 688 | blkdev_issue_flush(journal->j_fs_dev, GFP_KERNEL, NULL); |
diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c index 85a055ef93fe..20065c9f2479 100644 --- a/fs/jbd2/transaction.c +++ b/fs/jbd2/transaction.c | |||
@@ -2147,6 +2147,13 @@ int jbd2_journal_file_inode(handle_t *handle, struct jbd2_inode *jinode) | |||
2147 | jinode->i_next_transaction == transaction) | 2147 | jinode->i_next_transaction == transaction) |
2148 | goto done; | 2148 | goto done; |
2149 | 2149 | ||
2150 | /* | ||
2151 | * We only ever set this variable to 1 so the test is safe. Since | ||
2152 | * t_need_data_flush is likely to be set, we do the test to save some | ||
2153 | * cacheline bouncing | ||
2154 | */ | ||
2155 | if (!transaction->t_need_data_flush) | ||
2156 | transaction->t_need_data_flush = 1; | ||
2150 | /* On some different transaction's list - should be | 2157 | /* On some different transaction's list - should be |
2151 | * the committing one */ | 2158 | * the committing one */ |
2152 | if (jinode->i_transaction) { | 2159 | if (jinode->i_transaction) { |
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h index a32dcaec04e1..4d57955061f4 100644 --- a/include/linux/jbd2.h +++ b/include/linux/jbd2.h | |||
@@ -658,7 +658,9 @@ struct transaction_s | |||
658 | * waiting for it to finish. | 658 | * waiting for it to finish. |
659 | */ | 659 | */ |
660 | unsigned int t_synchronous_commit:1; | 660 | unsigned int t_synchronous_commit:1; |
661 | unsigned int t_flushed_data_blocks:1; | 661 | |
662 | /* Disk flush needs to be sent to fs partition [no locking] */ | ||
663 | int t_need_data_flush; | ||
662 | 664 | ||
663 | /* | 665 | /* |
664 | * For use by the filesystem to store fs-specific data | 666 | * For use by the filesystem to store fs-specific data |