diff options
Diffstat (limited to 'fs/jbd/transaction.c')
-rw-r--r-- | fs/jbd/transaction.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/fs/jbd/transaction.c b/fs/jbd/transaction.c index 2c9e8f5d13aa..2e9670e2237e 100644 --- a/fs/jbd/transaction.c +++ b/fs/jbd/transaction.c | |||
@@ -609,6 +609,12 @@ repeat: | |||
609 | goto done; | 609 | goto done; |
610 | 610 | ||
611 | /* | 611 | /* |
612 | * this is the first time this transaction is touching this buffer, | ||
613 | * reset the modified flag | ||
614 | */ | ||
615 | jh->b_modified = 0; | ||
616 | |||
617 | /* | ||
612 | * If there is already a copy-out version of this buffer, then we don't | 618 | * If there is already a copy-out version of this buffer, then we don't |
613 | * need to make another one | 619 | * need to make another one |
614 | */ | 620 | */ |
@@ -820,9 +826,16 @@ int journal_get_create_access(handle_t *handle, struct buffer_head *bh) | |||
820 | 826 | ||
821 | if (jh->b_transaction == NULL) { | 827 | if (jh->b_transaction == NULL) { |
822 | jh->b_transaction = transaction; | 828 | jh->b_transaction = transaction; |
829 | |||
830 | /* first access by this transaction */ | ||
831 | jh->b_modified = 0; | ||
832 | |||
823 | JBUFFER_TRACE(jh, "file as BJ_Reserved"); | 833 | JBUFFER_TRACE(jh, "file as BJ_Reserved"); |
824 | __journal_file_buffer(jh, transaction, BJ_Reserved); | 834 | __journal_file_buffer(jh, transaction, BJ_Reserved); |
825 | } else if (jh->b_transaction == journal->j_committing_transaction) { | 835 | } else if (jh->b_transaction == journal->j_committing_transaction) { |
836 | /* first access by this transaction */ | ||
837 | jh->b_modified = 0; | ||
838 | |||
826 | JBUFFER_TRACE(jh, "set next transaction"); | 839 | JBUFFER_TRACE(jh, "set next transaction"); |
827 | jh->b_next_transaction = transaction; | 840 | jh->b_next_transaction = transaction; |
828 | } | 841 | } |