diff options
author | Theodore Ts'o <tytso@mit.edu> | 2018-09-03 22:25:01 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2018-09-03 22:25:01 -0400 |
commit | 5f8c10936fab2b69a487400f2872902e597dd320 (patch) | |
tree | 239d1e7028b09e26dcbc03dd7f70a7c29d751a28 | |
parent | f0a459dec5495a3580f8d784555e6f8f3bf7f263 (diff) |
ext4: fix online resizing for bigalloc file systems with a 1k block size
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
-rw-r--r-- | fs/ext4/resize.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c index 33655a6eff4d..ebbc663d0798 100644 --- a/fs/ext4/resize.c +++ b/fs/ext4/resize.c | |||
@@ -19,6 +19,7 @@ | |||
19 | 19 | ||
20 | int ext4_resize_begin(struct super_block *sb) | 20 | int ext4_resize_begin(struct super_block *sb) |
21 | { | 21 | { |
22 | struct ext4_sb_info *sbi = EXT4_SB(sb); | ||
22 | int ret = 0; | 23 | int ret = 0; |
23 | 24 | ||
24 | if (!capable(CAP_SYS_RESOURCE)) | 25 | if (!capable(CAP_SYS_RESOURCE)) |
@@ -29,7 +30,7 @@ int ext4_resize_begin(struct super_block *sb) | |||
29 | * because the user tools have no way of handling this. Probably a | 30 | * because the user tools have no way of handling this. Probably a |
30 | * bad time to do it anyways. | 31 | * bad time to do it anyways. |
31 | */ | 32 | */ |
32 | if (EXT4_SB(sb)->s_sbh->b_blocknr != | 33 | if (EXT4_B2C(sbi, sbi->s_sbh->b_blocknr) != |
33 | le32_to_cpu(EXT4_SB(sb)->s_es->s_first_data_block)) { | 34 | le32_to_cpu(EXT4_SB(sb)->s_es->s_first_data_block)) { |
34 | ext4_warning(sb, "won't resize using backup superblock at %llu", | 35 | ext4_warning(sb, "won't resize using backup superblock at %llu", |
35 | (unsigned long long)EXT4_SB(sb)->s_sbh->b_blocknr); | 36 | (unsigned long long)EXT4_SB(sb)->s_sbh->b_blocknr); |