mirror of
https://github.com/torvalds/linux.git
synced 2026-06-09 23:23:53 +02:00
ext4: avoid duplicate writes of the backup bg descriptor blocks
commit 2ebd1704de 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 <xiaoqiangnk@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
1079d76f47
commit
2de1ece4de
|
|
@ -1302,13 +1302,15 @@ static int ext4_flex_group_add(struct super_block *sb,
|
|||
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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user