Whamcloud - gitweb
Branch HEAD
[fs/lustre-release.git] / lustre / kernel_patches / patches / jbd-copy-out-everything.patch
1 Index: linux/fs/jbd/journal.c
2 ===================================================================
3 --- linux.orig/fs/jbd/journal.c
4 +++ linux/fs/jbd/journal.c
5 @@ -323,7 +323,7 @@ int journal_write_metadata_buffer(transa
6                                   struct journal_head **jh_out,
7                                   int blocknr)
8  {
9 -       int need_copy_out = 0;
10 +       int need_copy_out;
11         int done_copy_out = 0;
12         int do_escape = 0;
13         char *mapped_data;
14 @@ -369,7 +369,8 @@ repeat:
15                                 cpu_to_be32(JFS_MAGIC_NUMBER)) {
16                 need_copy_out = 1;
17                 do_escape = 1;
18 -       }
19 +       } else
20 +               need_copy_out = jh_in->b_committed_data == NULL;
21         kunmap_atomic(mapped_data, KM_USER0);
22  
23         /*
24 Index: linux/fs/jbd/transaction.c
25 ===================================================================
26 --- linux.orig/fs/jbd/transaction.c
27 +++ linux/fs/jbd/transaction.c
28 @@ -817,6 +817,15 @@ int journal_get_create_access(handle_t *
29          */
30         jbd_lock_bh_state(bh);
31         spin_lock(&journal->j_list_lock);
32 +       if (!((jh->b_transaction == transaction ||
33 +               jh->b_transaction == NULL ||
34 +               (jh->b_transaction == journal->j_committing_transaction &&
35 +                jh->b_jlist == BJ_Forget)))) {
36 +               printk("%s: %p %p %p %p %i\n", __FUNCTION__,
37 +                      jh, jh->b_transaction, transaction,
38 +                      journal->j_committing_transaction, jh->b_jlist);
39 +               
40 +       }
41         J_ASSERT_JH(jh, (jh->b_transaction == transaction ||
42                 jh->b_transaction == NULL ||
43                 (jh->b_transaction == journal->j_committing_transaction &&
44 @@ -1115,6 +1124,8 @@ int journal_dirty_metadata(handle_t *han
45         journal_t *journal = transaction->t_journal;
46         struct journal_head *jh = bh2jh(bh);
47  
48 +       BUG_ON(transaction == NULL);            
49 +
50         jbd_debug(5, "journal_head %p\n", jh);
51         JBUFFER_TRACE(jh, "entry");
52         if (is_handle_aborted(handle))