[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Dealing with ext3 and sparse_super
From: |
Augusto Beiro |
Subject: |
Re: Dealing with ext3 and sparse_super |
Date: |
Thu, 12 May 2005 18:12:39 +0200 |
User-agent: |
Internet Messaging Program (IMP) H3 (4.0.3) |
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.