]> git.ipfire.org Git - thirdparty/e2fsprogs.git/blobdiff - debugfs/set_fields.c
debugfs, e2fsck: fix s_desc_size handling
[thirdparty/e2fsprogs.git] / debugfs / set_fields.c
index 064de395d4f60ba38c690f3d1a29e6ca71d7cb95..9c3b0001436d2d6904ca5fa70bd3bc4554ba5f8a 100644 (file)
@@ -702,11 +702,14 @@ void do_set_block_group_descriptor(int argc, char *argv[])
        int                     size;
 
        /*
-        *Determine whether we are editing an ext2 or ext4 block
-        * group descriptor
+        * Determine whether we are editing an ext2 or ext4 block group
+        * descriptor.  Descriptors larger than ext4_group_desc cannot
+        * have their fields edited yet, because they do not have any
+        * names assigned.  When that happens, this function needs to
+        * be updated for the new descriptor struct and fields.
         */
-       if (current_fs && current_fs->super->s_feature_incompat &
-           EXT4_FEATURE_INCOMPAT_64BIT) {
+       if (current_fs &&
+           EXT2_DESC_SIZE(current_fs->super) >= EXT2_MIN_DESC_SIZE_64BIT) {
                table = ext4_bg_fields;
                edit = &set_gd4;
                size = sizeof(set_gd4);