Skip to content

Commit ba48e66

Browse files
tytsogregkh
authored andcommitted
ext4: fix online resizing for bigalloc file systems with a 1k block size
commit 5f8c109 upstream. 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 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 6a4d7b5 commit ba48e66

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

fs/ext4/resize.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
int ext4_resize_begin(struct super_block *sb)
2121
{
22+
struct ext4_sb_info *sbi = EXT4_SB(sb);
2223
int ret = 0;
2324

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

0 commit comments

Comments
 (0)