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

    ext4: avoid duplicate writes of the backup bg descriptor blocks

to the 3.6-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-avoid-duplicate-writes-of-the-backup-bg-descriptor-blocks.patch
and it can be found in the queue-3.6 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.


>From 2ebd1704ded88a8ae29b5f3998b13959c715c4be Mon Sep 17 00:00:00 2001
From: Yongqiang Yang <[email protected]>
Date: Wed, 5 Sep 2012 01:27:50 -0400
Subject: ext4: avoid duplicate writes of the backup bg descriptor blocks

From: Yongqiang Yang <[email protected]>

commit 2ebd1704ded88a8ae29b5f3998b13959c715c4be upstream.

The resize code was needlessly writing the backup block group
descriptor blocks multiple times (once per block group) during an
online resize.

Signed-off-by: Yongqiang Yang <[email protected]>
Signed-off-by: "Theodore Ts'o" <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 fs/ext4/resize.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

--- a/fs/ext4/resize.c
+++ b/fs/ext4/resize.c
@@ -1358,13 +1358,15 @@ exit_journal:
                err = err2;
 
        if (!err) {
-               int i;
+               int gdb_num = group / EXT4_DESC_PER_BLOCK(sb);
+               int gdb_num_end = ((group + flex_gd->count - 1) /
+                                  EXT4_DESC_PER_BLOCK(sb));
+
                update_backups(sb, sbi->s_sbh->b_blocknr, (char *)es,
                               sizeof(struct ext4_super_block));
-               for (i = 0; i < flex_gd->count; i++, group++) {
+               for (; gdb_num <= gdb_num_end; gdb_num++) {
                        struct buffer_head *gdb_bh;
-                       int gdb_num;
-                       gdb_num = group / EXT4_BLOCKS_PER_GROUP(sb);
+
                        gdb_bh = sbi->s_group_desc[gdb_num];
                        update_backups(sb, gdb_bh->b_blocknr, gdb_bh->b_data,
                                       gdb_bh->b_size);


Patches currently in stable-queue which might be from [email protected] are

queue-3.6/ext4-don-t-copy-non-existent-gdt-blocks-when-resizing.patch
queue-3.6/ext4-ignore-last-group-w-o-enough-space-when-resizing-instead-of-bug-ing.patch
queue-3.6/ext4-avoid-duplicate-writes-of-the-backup-bg-descriptor-blocks.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to