]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 7 Dec 2015 18:25:00 +0000 (10:25 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 7 Dec 2015 18:25:00 +0000 (10:25 -0800)
Pull ext4 fixes from Ted Ts'o:
 "Ext4 bug fixes for v4.4, including fixes for post-2038 time encodings,
  some endian conversion problems with ext4 encryption, potential memory
  leaks after truncate in data=journal mode, and an ocfs2 regression
  caused by a jbd2 performance improvement"

* tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
  jbd2: fix null committed data return in undo_access
  ext4: add "static" to ext4_seq_##name##_fops struct
  ext4: fix an endianness bug in ext4_encrypted_follow_link()
  ext4: fix an endianness bug in ext4_encrypted_zeroout()
  jbd2: Fix unreclaimed pages after truncate in data=journal mode
  ext4: Fix handling of extended tv_sec

1  2 
fs/jbd2/transaction.c

diff --combined fs/jbd2/transaction.c
index 89463eee67914643a02ce711463e62fac0b83c8d,1498ad9f731ac88d839db9e83cf6fa1d8b4a4ecf..ca181e81c765518d4a599025c914adbac626e739
@@@ -1009,7 -1009,8 +1009,8 @@@ out
  }
  
  /* Fast check whether buffer is already attached to the required transaction */
- static bool jbd2_write_access_granted(handle_t *handle, struct buffer_head *bh)
+ static bool jbd2_write_access_granted(handle_t *handle, struct buffer_head *bh,
+                                                       bool undo)
  {
        struct journal_head *jh;
        bool ret = false;
        jh = READ_ONCE(bh->b_private);
        if (!jh)
                goto out;
+       /* For undo access buffer must have data copied */
+       if (undo && !jh->b_committed_data)
+               goto out;
        if (jh->b_transaction != handle->h_transaction &&
            jh->b_next_transaction != handle->h_transaction)
                goto out;
@@@ -1073,7 -1077,7 +1077,7 @@@ int jbd2_journal_get_write_access(handl
        struct journal_head *jh;
        int rc;
  
-       if (jbd2_write_access_granted(handle, bh))
+       if (jbd2_write_access_granted(handle, bh, false))
                return 0;
  
        jh = jbd2_journal_add_journal_head(bh);
@@@ -1210,7 -1214,7 +1214,7 @@@ int jbd2_journal_get_undo_access(handle
        char *committed_data = NULL;
  
        JBUFFER_TRACE(jh, "entry");
-       if (jbd2_write_access_granted(handle, bh))
+       if (jbd2_write_access_granted(handle, bh, true))
                return 0;
  
        jh = jbd2_journal_add_journal_head(bh);
@@@ -1937,8 -1941,8 +1941,8 @@@ out
   * @journal: journal for operation
   * @page: to try and free
   * @gfp_mask: we use the mask to detect how hard should we try to release
 - * buffers. If __GFP_WAIT and __GFP_FS is set, we wait for commit code to
 - * release the buffers.
 + * buffers. If __GFP_DIRECT_RECLAIM and __GFP_FS is set, we wait for commit
 + * code to release the buffers.
   *
   *
   * For all the buffers on this page,
@@@ -2152,6 -2156,7 +2156,7 @@@ static int journal_unmap_buffer(journal
  
                if (!buffer_dirty(bh)) {
                        /* bdflush has written it.  We can drop it now */
+                       __jbd2_journal_remove_checkpoint(jh);
                        goto zap_buffer;
                }
  
                                /* The orphan record's transaction has
                                 * committed.  We can cleanse this buffer */
                                clear_buffer_jbddirty(bh);
+                               __jbd2_journal_remove_checkpoint(jh);
                                goto zap_buffer;
                        }
                }