Skip to content

Commit

Permalink
ext4: fix online resizing for bigalloc file systems with a 1k block size
Browse files Browse the repository at this point in the history
An online resize of a file system with the bigalloc feature enabled
and a 1k block size would be refused since ext4_resize_begin() did not
understand s_first_data_block is 0 for all bigalloc file systems, even
when the block size is 1k.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@vger.kernel.org
  • Loading branch information
tytso committed Sep 4, 2018
1 parent f0a459d commit 5f8c109
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/ext4/resize.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

int ext4_resize_begin(struct super_block *sb)
{
struct ext4_sb_info *sbi = EXT4_SB(sb);
int ret = 0;

if (!capable(CAP_SYS_RESOURCE))
Expand All @@ -29,7 +30,7 @@ int ext4_resize_begin(struct super_block *sb)
* because the user tools have no way of handling this. Probably a
* bad time to do it anyways.
*/
if (EXT4_SB(sb)->s_sbh->b_blocknr !=
if (EXT4_B2C(sbi, sbi->s_sbh->b_blocknr) !=
le32_to_cpu(EXT4_SB(sb)->s_es->s_first_data_block)) {
ext4_warning(sb, "won't resize using backup superblock at %llu",
(unsigned long long)EXT4_SB(sb)->s_sbh->b_blocknr);
Expand Down

0 comments on commit 5f8c109

Please sign in to comment.