Whamcloud - gitweb
resize2fs: allow meta_bg/64-bit file systems to be online resized
authorTheodore Ts'o <tytso@mit.edu>
Fri, 31 Aug 2012 19:31:50 +0000 (15:31 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 14 Sep 2012 03:05:32 +0000 (23:05 -0400)
Resize2fs can't handle resizing flex_bg file systems that do not have
the resize inode, but when the kernel adds support for resizing using
the meta_bg layout, we should allow it be able to resize the file
system.

So move the flex_bg/resize_inode check to the just before we start
doing the off-line resize, instead of doing it earlier where it would
prohibit these file systems for both on-line and off-line resizes.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
resize/main.c

index 228e85a..b601557 100644 (file)
@@ -316,25 +316,6 @@ int main (int argc, char ** argv)
                exit(1);
        }
 
-       /*
-        * XXXX   The combination of flex_bg and !resize_inode causes
-        * major problems for resize2fs, since when the group descriptors
-        * grow in size this can potentially require multiple inode
-        * tables to be moved aside to make room, and resize2fs chokes
-        * rather badly in this scenario.  It's a rare combination,
-        * except when a filesystem is expanded more than a certain
-        * size, so for now, we'll just prohibit that combination.
-        * This is something we should fix eventually, though.
-        */
-       if ((fs->super->s_feature_incompat & EXT4_FEATURE_INCOMPAT_FLEX_BG) &&
-           !(fs->super->s_feature_compat & EXT2_FEATURE_COMPAT_RESIZE_INODE)) {
-               com_err(program_name, 0, _("%s: The combination of flex_bg "
-                                          "and\n\t!resize_inode features "
-                                          "is not supported by resize2fs.\n"),
-                       device_name);
-               exit(1);
-       }
-
        min_size = calculate_minimum_resize_size(fs);
 
        if (print_min_size) {
@@ -457,6 +438,28 @@ int main (int argc, char ** argv)
                                device_name);
                        exit(1);
                }
+               /*
+                * XXXX The combination of flex_bg and !resize_inode
+                * causes major problems for resize2fs, since when the
+                * group descriptors grow in size this can potentially
+                * require multiple inode tables to be moved aside to
+                * make room, and resize2fs chokes rather badly in
+                * this scenario.  It's a rare combination, except
+                * when a filesystem is expanded more than a certain
+                * size, so for now, we'll just prohibit that
+                * combination.  This is something we should fix
+                * eventually, though.
+                */
+               if ((fs->super->s_feature_incompat &
+                    EXT4_FEATURE_INCOMPAT_FLEX_BG) &&
+                   !(fs->super->s_feature_compat &
+                     EXT2_FEATURE_COMPAT_RESIZE_INODE)) {
+                       com_err(program_name, 0, _("%s: The combination of "
+                               "flex_bg and\n\t!resize_inode features "
+                               "is not supported by resize2fs.\n"),
+                               device_name);
+                       exit(1);
+               }
                printf(_("Resizing the filesystem on "
                         "%s to %llu (%dk) blocks.\n"),
                       device_name, new_size, fs->blocksize / 1024);