Blame SOURCES/e2fsprogs-1.42.9-disable-resize_inode-feature-if-64bit-feature-is-enabled.patch

ec15cf
From ca35619b7209a50ee0fd1f2799cbe232277f39cc Mon Sep 17 00:00:00 2001
ec15cf
From: Eryu Guan <guaneryu@gmail.com>
ec15cf
Date: Thu, 4 Jul 2013 17:05:10 +0800
ec15cf
Subject: [PATCH 3/8] mke2fs: disable resize_inode feature if 64bit feature is
ec15cf
 enabled
ec15cf
ec15cf
Since auto_64-bit_support is on by default, resize_inode feature will
ec15cf
be disabled when creating a >16T ext4 according to mke2fs.conf(5).
ec15cf
ec15cf
This should also be done when making ext4 with "-O 64bit" to enable
ec15cf
64bit feature explicitly. Otherwise online resize to enlarge a
ec15cf
over-16T fs to larger would fail.
ec15cf
ec15cf
[root@localhost resize]# truncate -s 50t fs.img
ec15cf
[root@localhost resize]# losetup /dev/loop0 fs.img
ec15cf
[root@localhost resize]# mkfs -t ext4 -O 64bit /dev/loop0 30t
ec15cf
[root@localhost resize]# mount /dev/loop0 mnt
ec15cf
[root@localhost resize]# resize2fs /dev/loop0
ec15cf
resize2fs 1.42.7 (21-Jan-2013)
ec15cf
Filesystem at /dev/loop0 is mounted on /root/resize/mnt; on-line resizing required
ec15cf
old_desc_blocks = 3840, new_desc_blocks = 6400
ec15cf
resize2fs: Invalid argument While checking for on-line resizing support
ec15cf
ec15cf
And dmesg shows
ec15cf
[688378.442623] EXT4-fs (loop0): resizing filesystem from 6710886400 to 13421772800 blocks
ec15cf
[688378.443216] EXT4-fs warning (device loop0): verify_reserved_gdb:700: reserved GDT 3201 missing grp 177147 (5804756097)
ec15cf
[688378.443222] EXT4-fs (loop0): resized filesystem to 8858370048
ec15cf
[688378.528451] EXT4-fs warning (device loop0): ext4_group_extend:1710: can't shrink FS - resize aborted
ec15cf
ec15cf
With this fix resize2fs could do the online enlarge correctly.
ec15cf
ec15cf
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
ec15cf
---
ec15cf
 misc/mke2fs.c | 3 +++
ec15cf
 1 file changed, 3 insertions(+)
ec15cf
ec15cf
diff --git a/misc/mke2fs.c b/misc/mke2fs.c
ec15cf
index e970bbe..76ea60b 100644
ec15cf
--- a/misc/mke2fs.c
ec15cf
+++ b/misc/mke2fs.c
ec15cf
@@ -1836,6 +1836,9 @@ profile_error:
ec15cf
 	 * 32-bit vs 64-bit block number support.
ec15cf
 	 */
ec15cf
 	if ((fs_blocks_count > MAX_32_NUM) &&
ec15cf
+	    (fs_param.s_feature_incompat & EXT4_FEATURE_INCOMPAT_64BIT))
ec15cf
+		fs_param.s_feature_compat &= ~EXT2_FEATURE_COMPAT_RESIZE_INODE;
ec15cf
+	if ((fs_blocks_count > MAX_32_NUM) &&
ec15cf
 	    !(fs_param.s_feature_incompat & EXT4_FEATURE_INCOMPAT_64BIT) &&
ec15cf
 	    get_bool_from_profile(fs_types, "auto_64-bit_support", 0)) {
ec15cf
 		fs_param.s_feature_incompat |= EXT4_FEATURE_INCOMPAT_64BIT;
ec15cf
-- 
ec15cf
1.8.3.1
ec15cf