Hi, still dealing with ext3 and sparse_super

I think the bug is here:

 start = EXT2_SUPER_FIRST_DATA_BLOCK(fs->sb)
                       + (i * EXT2_SUPER_BLOCKS_PER_GROUP(fs->sb));

               it = start + fs->itoffset;

               if (ext2_is_group_sparse(fs, i))
               {
                       bb = it - 2;
                       ib = it - 1;

               }
               else
               {
                       bb = start;
                       ib = start + 1;
               }

               if (EXT2_GROUP_BLOCK_BITMAP(fs->gd[i]) != bb ||
                   EXT2_GROUP_INODE_BITMAP(fs->gd[i]) != ib ||
                   EXT2_GROUP_INODE_TABLE(fs->gd[i]) != it)
               {
                       ped_exception_throw (PED_EXCEPTION_NO_FEATURE,
                               PED_EXCEPTION_CANCEL,
                       _("This ext2 filesystem has a rather strange layout!  "
                         "Parted can't resize this (yet)."));
                       return 0;
               }

Seems fs->iofsset is calculated from superblock, so if group is parse,
everything is fine, but if group is no sparse, bb is good, ib is good, but it
is not correct when checking values with fs->gd[i]. I think adding 'it=start+3'
would do the trick:


               {
                       bb = start;
                       ib = start + 1;
                       it = start + 3;
               }

I've tested this solution and seems to work well.

Cheers.


_______________________________________________ Bug-parted mailing list [email protected] http://lists.gnu.org/mailman/listinfo/bug-parted

Reply via email to