This is a note to let you know that I've just added the patch titled

    ext4: fix unjournalled bg descriptor while initializing inode bitmap

to the 3.14-stable tree which can be found at:
    
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     ext4-fix-unjournalled-bg-descriptor-while-initializing-inode-bitmap.patch
and it can be found in the queue-3.14 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From 61c219f5814277ecb71d64cb30297028d6665979 Mon Sep 17 00:00:00 2001
From: Theodore Ts'o <ty...@mit.edu>
Date: Sat, 5 Jul 2014 16:28:35 -0400
Subject: ext4: fix unjournalled bg descriptor while initializing inode bitmap

From: Theodore Ts'o <ty...@mit.edu>

commit 61c219f5814277ecb71d64cb30297028d6665979 upstream.

The first time that we allocate from an uninitialized inode allocation
bitmap, if the block allocation bitmap is also uninitalized, we need
to get write access to the block group descriptor before we start
modifying the block group descriptor flags and updating the free block
count, etc.  Otherwise, there is the potential of a bad journal
checksum (if journal checksums are enabled), and of the file system
becoming inconsistent if we crash at exactly the wrong time.

Signed-off-by: Theodore Ts'o <ty...@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gre...@linuxfoundation.org>

---
 fs/ext4/ialloc.c |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

--- a/fs/ext4/ialloc.c
+++ b/fs/ext4/ialloc.c
@@ -851,6 +851,13 @@ got:
                goto out;
        }
 
+       BUFFER_TRACE(group_desc_bh, "get_write_access");
+       err = ext4_journal_get_write_access(handle, group_desc_bh);
+       if (err) {
+               ext4_std_error(sb, err);
+               goto out;
+       }
+
        /* We may have to initialize the block bitmap if it isn't already */
        if (ext4_has_group_desc_csum(sb) &&
            gdp->bg_flags & cpu_to_le16(EXT4_BG_BLOCK_UNINIT)) {
@@ -887,13 +894,6 @@ got:
                }
        }
 
-       BUFFER_TRACE(group_desc_bh, "get_write_access");
-       err = ext4_journal_get_write_access(handle, group_desc_bh);
-       if (err) {
-               ext4_std_error(sb, err);
-               goto out;
-       }
-
        /* Update the relevant bg descriptor fields */
        if (ext4_has_group_desc_csum(sb)) {
                int free;


Patches currently in stable-queue which might be from ty...@mit.edu are

queue-3.14/ext4-fix-a-potential-deadlock-in-__ext4_es_shrink.patch
queue-3.14/ext4-disable-synchronous-transaction-batching-if-max_batch_time-0.patch
queue-3.14/ext4-fix-unjournalled-bg-descriptor-while-initializing-inode-bitmap.patch
queue-3.14/ext4-clarify-ext4_error-message-in-ext4_mb_generate_buddy_error.patch
queue-3.14/ext4-clarify-error-count-warning-messages.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to