aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/resize.c
diff options
context:
space:
mode:
authorYongqiang Yang <xiaoqiangnk@gmail.com>2012-09-05 01:27:50 -0400
committerTheodore Ts'o <tytso@mit.edu>2012-09-05 01:27:50 -0400
commit2ebd1704ded88a8ae29b5f3998b13959c715c4be (patch)
tree3b30f6ab1a26169bd2557f23e0b688814516513b /fs/ext4/resize.c
parent6df935ad2fced9033ab52078825fcaf6365f34b7 (diff)
ext4: avoid duplicate writes of the backup bg descriptor blocks
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 <xiaoqiangnk@gmail.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Cc: stable@vger.kernel.org
Diffstat (limited to 'fs/ext4/resize.c')
-rw-r--r--fs/ext4/resize.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c
index a0ee26c23dd8..365d800ff8c1 100644
--- a/fs/ext4/resize.c
+++ b/fs/ext4/resize.c
@@ -1358,13 +1358,15 @@ exit_journal:
1358 err = err2; 1358 err = err2;
1359 1359
1360 if (!err) { 1360 if (!err) {
1361 int i; 1361 int gdb_num = group / EXT4_DESC_PER_BLOCK(sb);
1362 int gdb_num_end = ((group + flex_gd->count - 1) /
1363 EXT4_DESC_PER_BLOCK(sb));
1364
1362 update_backups(sb, sbi->s_sbh->b_blocknr, (char *)es, 1365 update_backups(sb, sbi->s_sbh->b_blocknr, (char *)es,
1363 sizeof(struct ext4_super_block)); 1366 sizeof(struct ext4_super_block));
1364 for (i = 0; i < flex_gd->count; i++, group++) { 1367 for (; gdb_num <= gdb_num_end; gdb_num++) {
1365 struct buffer_head *gdb_bh; 1368 struct buffer_head *gdb_bh;
1366 int gdb_num; 1369
1367 gdb_num = group / EXT4_BLOCKS_PER_GROUP(sb);
1368 gdb_bh = sbi->s_group_desc[gdb_num]; 1370 gdb_bh = sbi->s_group_desc[gdb_num];
1369 update_backups(sb, gdb_bh->b_blocknr, gdb_bh->b_data, 1371 update_backups(sb, gdb_bh->b_blocknr, gdb_bh->b_data,
1370 gdb_bh->b_size); 1372 gdb_bh->b_size);