summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorYongqiang Yang <xiaoqiangnk@gmail.com>2012-09-05 01:25:50 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-10-13 05:38:48 +0900
commit1079d76f47379886ebfd3ae0f79a9f6cd62df29e (patch)
treeb55356b4b5ed7fae6071bc02737ed331479796e7 /fs
parent2d5a1fbc0c25ab4a2e2770a5c729467893407009 (diff)
downloadlinux-stable-1079d76f47379886ebfd3ae0f79a9f6cd62df29e.tar.gz
linux-stable-1079d76f47379886ebfd3ae0f79a9f6cd62df29e.tar.bz2
linux-stable-1079d76f47379886ebfd3ae0f79a9f6cd62df29e.zip
ext4: don't copy non-existent gdt blocks when resizing
commit 6df935ad2fced9033ab52078825fcaf6365f34b7 upstream. The resize code was copying blocks at the beginning of each block group in order to copy the superblock and block group descriptor table (gdt) blocks. This was, unfortunately, being done even for block groups that did not have super blocks or gdt blocks. This is a complete waste of perfectly good I/O bandwidth, to skip writing those blocks for sparse bg's. Signed-off-by: Yongqiang Yang <xiaoqiangnk@gmail.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/ext4/resize.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c
index 46d9ec8453f2..257d2f00311f 100644
--- a/fs/ext4/resize.c
+++ b/fs/ext4/resize.c
@@ -456,6 +456,9 @@ static int setup_new_flex_group_blocks(struct super_block *sb,
gdblocks = ext4_bg_num_gdb(sb, group);
start = ext4_group_first_block_no(sb, group);
+ if (!ext4_bg_has_super(sb, group))
+ goto handle_itb;
+
/* Copy all of the GDT blocks into the backup in this group */
for (j = 0, block = start + 1; j < gdblocks; j++, block++) {
struct buffer_head *gdb;
@@ -498,6 +501,7 @@ static int setup_new_flex_group_blocks(struct super_block *sb,
goto out;
}
+handle_itb:
/* Initialize group tables of the grop @group */
if (!(bg_flags[i] & EXT4_BG_INODE_ZEROED))
goto handle_bb;