|
@@ -23,6 +23,18 @@ int ext4_resize_begin(struct super_block *sb)
|
|
if (!capable(CAP_SYS_RESOURCE))
|
|
if (!capable(CAP_SYS_RESOURCE))
|
|
return -EPERM;
|
|
return -EPERM;
|
|
|
|
|
|
|
|
+ /*
|
|
|
|
+ * If we are not using the primary superblock/GDT copy don't resize,
|
|
|
|
+ * 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 !=
|
|
|
|
+ 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);
|
|
|
|
+ return -EPERM;
|
|
|
|
+ }
|
|
|
|
+
|
|
/*
|
|
/*
|
|
* We are not allowed to do online-resizing on a filesystem mounted
|
|
* We are not allowed to do online-resizing on a filesystem mounted
|
|
* with error, because it can destroy the filesystem easily.
|
|
* with error, because it can destroy the filesystem easily.
|
|
@@ -758,18 +770,6 @@ static int add_new_gdb(handle_t *handle, struct inode *inode,
|
|
"EXT4-fs: ext4_add_new_gdb: adding group block %lu\n",
|
|
"EXT4-fs: ext4_add_new_gdb: adding group block %lu\n",
|
|
gdb_num);
|
|
gdb_num);
|
|
|
|
|
|
- /*
|
|
|
|
- * If we are not using the primary superblock/GDT copy don't resize,
|
|
|
|
- * 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 !=
|
|
|
|
- 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);
|
|
|
|
- return -EPERM;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
gdb_bh = sb_bread(sb, gdblock);
|
|
gdb_bh = sb_bread(sb, gdblock);
|
|
if (!gdb_bh)
|
|
if (!gdb_bh)
|
|
return -EIO;
|
|
return -EIO;
|