add patch fix-warning-inside-ext4_convert_unwritten_extents_endio
[ext4-patch-queue.git] / disable-writeback
blob5f5399dd429f25e4dcc300e5a96e870eb4a805c6
1 Disable writeback
3 From: Abutalib Aghayev <agayev@cs.cmu.edu>
5 Now that we have a working cleaner, disable writeback of metadata blocks.
7 Signed-off-by: Abutalib Aghayev <agayev@cs.cmu.edu>
8 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
9 ---
10  fs/jbd2/transaction.c        | 5 ++++-
11  include/linux/journal-head.h | 5 +++++
12  2 files changed, 9 insertions(+), 1 deletion(-)
14 diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c
15 index 5e659ee08d6a..1bd1a1530fbc 100644
16 --- a/fs/jbd2/transaction.c
17 +++ b/fs/jbd2/transaction.c
18 @@ -894,6 +894,8 @@ do_get_write_access(handle_t *handle, struct journal_head *jh,
19             jh->b_next_transaction == transaction)
20                 goto done;
22 +       jh->b_jflags = journal->j_flags;
24         /*
25          * this is the first time this transaction is touching this buffer,
26          * reset the modified flag
27 @@ -1863,7 +1865,8 @@ static void __jbd2_journal_temp_unlink_buffer(struct journal_head *jh)
29         __blist_del_buffer(list, jh);
30         jh->b_jlist = BJ_None;
31 -       if (transaction && is_journal_aborted(transaction->t_journal))
32 +       if ((transaction && is_journal_aborted(transaction->t_journal)) ||
33 +           (jh->b_jflags & JBD2_LAZY))
34                 clear_buffer_jbddirty(bh);
35         else if (test_clear_buffer_jbddirty(bh))
36                 mark_buffer_dirty(bh);  /* Expose it to the VM */
37 diff --git a/include/linux/journal-head.h b/include/linux/journal-head.h
38 index 98cd41bb39c8..d4cce2bab7ff 100644
39 --- a/include/linux/journal-head.h
40 +++ b/include/linux/journal-head.h
41 @@ -58,6 +58,11 @@ struct journal_head {
42         char *b_committed_data;
44         /*
45 +        * Copy of journal->j_flags
46 +        */
47 +       unsigned b_jflags;
49 +       /*
50          * Pointer to the compound transaction which owns this buffer's
51          * metadata: either the running transaction or the committing
52          * transaction (if there is one).  Only applies to buffers on a