diff options
Diffstat (limited to 'fs/ext4/resize.c')
-rw-r--r-- | fs/ext4/resize.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c index bf76f405a5f9..8a8ec6293b19 100644 --- a/fs/ext4/resize.c +++ b/fs/ext4/resize.c | |||
@@ -24,6 +24,18 @@ int ext4_resize_begin(struct super_block *sb) | |||
24 | return -EPERM; | 24 | return -EPERM; |
25 | 25 | ||
26 | /* | 26 | /* |
27 | * If we are not using the primary superblock/GDT copy don't resize, | ||
28 | * because the user tools have no way of handling this. Probably a | ||
29 | * bad time to do it anyways. | ||
30 | */ | ||
31 | if (EXT4_SB(sb)->s_sbh->b_blocknr != | ||
32 | le32_to_cpu(EXT4_SB(sb)->s_es->s_first_data_block)) { | ||
33 | ext4_warning(sb, "won't resize using backup superblock at %llu", | ||
34 | (unsigned long long)EXT4_SB(sb)->s_sbh->b_blocknr); | ||
35 | return -EPERM; | ||
36 | } | ||
37 | |||
38 | /* | ||
27 | * We are not allowed to do online-resizing on a filesystem mounted | 39 | * We are not allowed to do online-resizing on a filesystem mounted |
28 | * with error, because it can destroy the filesystem easily. | 40 | * with error, because it can destroy the filesystem easily. |
29 | */ | 41 | */ |
@@ -758,18 +770,6 @@ static int add_new_gdb(handle_t *handle, struct inode *inode, | |||
758 | "EXT4-fs: ext4_add_new_gdb: adding group block %lu\n", | 770 | "EXT4-fs: ext4_add_new_gdb: adding group block %lu\n", |
759 | gdb_num); | 771 | gdb_num); |
760 | 772 | ||
761 | /* | ||
762 | * If we are not using the primary superblock/GDT copy don't resize, | ||
763 | * because the user tools have no way of handling this. Probably a | ||
764 | * bad time to do it anyways. | ||
765 | */ | ||
766 | if (EXT4_SB(sb)->s_sbh->b_blocknr != | ||
767 | le32_to_cpu(EXT4_SB(sb)->s_es->s_first_data_block)) { | ||
768 | ext4_warning(sb, "won't resize using backup superblock at %llu", | ||
769 | (unsigned long long)EXT4_SB(sb)->s_sbh->b_blocknr); | ||
770 | return -EPERM; | ||
771 | } | ||
772 | |||
773 | gdb_bh = sb_bread(sb, gdblock); | 773 | gdb_bh = sb_bread(sb, gdblock); |
774 | if (!gdb_bh) | 774 | if (!gdb_bh) |
775 | return -EIO; | 775 | return -EIO; |