ext4: don't copy non-existent gdt blocks when resizing
authorYongqiang Yang <xiaoqiangnk@gmail.com>
Wed, 5 Sep 2012 05:25:50 +0000 (01:25 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 12 Oct 2012 20:47:08 +0000 (05:47 +0900)
commit27a62fabecc937565dbb7adc8c351347a7aa083d
tree72aa76f0dd3864200b3733a7b65613dfcfe76699
parent7185ca89303d2e515b2e210e1d1f3a8d12a90b2b
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>
fs/ext4/resize.c