diff options
-rw-r--r-- | fs/ext4/resize.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c index 8a8ec6293b19..cf0c472047e3 100644 --- a/fs/ext4/resize.c +++ b/fs/ext4/resize.c | |||
@@ -1432,12 +1432,15 @@ static int ext4_flex_group_add(struct super_block *sb, | |||
1432 | goto exit; | 1432 | goto exit; |
1433 | /* | 1433 | /* |
1434 | * We will always be modifying at least the superblock and GDT | 1434 | * We will always be modifying at least the superblock and GDT |
1435 | * block. If we are adding a group past the last current GDT block, | 1435 | * blocks. If we are adding a group past the last current GDT block, |
1436 | * we will also modify the inode and the dindirect block. If we | 1436 | * we will also modify the inode and the dindirect block. If we |
1437 | * are adding a group with superblock/GDT backups we will also | 1437 | * are adding a group with superblock/GDT backups we will also |
1438 | * modify each of the reserved GDT dindirect blocks. | 1438 | * modify each of the reserved GDT dindirect blocks. |
1439 | */ | 1439 | */ |
1440 | credit = flex_gd->count * 4 + reserved_gdb; | 1440 | credit = 3; /* sb, resize inode, resize inode dindirect */ |
1441 | /* GDT blocks */ | ||
1442 | credit += 1 + DIV_ROUND_UP(flex_gd->count, EXT4_DESC_PER_BLOCK(sb)); | ||
1443 | credit += reserved_gdb; /* Reserved GDT dindirect blocks */ | ||
1441 | handle = ext4_journal_start_sb(sb, EXT4_HT_RESIZE, credit); | 1444 | handle = ext4_journal_start_sb(sb, EXT4_HT_RESIZE, credit); |
1442 | if (IS_ERR(handle)) { | 1445 | if (IS_ERR(handle)) { |
1443 | err = PTR_ERR(handle); | 1446 | err = PTR_ERR(handle); |