[Cluster-devel] [PATCH] GFS2: Add a next-resource-group pointer to resource groups

Andreas Gruenbacher agruenba at redhat.com
Tue Jan 12 13:30:56 UTC 2016


On Tue, Jan 12, 2016 at 2:12 PM, Andrew Price <anprice at redhat.com> wrote:
> On 12/01/16 12:39, Andreas Gruenbacher wrote:
>>
>> On Tue, Jan 12, 2016 at 12:39 PM, Andrew Price <anprice at redhat.com> wrote:
>>>
>>> Add a new rg_skip field to struct gfs2_rgrp, replacing __pad. The
>>> rg_skip field has the following meaning:
>>>
>>> - If rg_skip is zero, it is considered unset and not useful.
>>> - If rg_skip is non-zero, its value will be the number of blocks between
>>>    this rgrp's address and the next rgrp's address. This can be used as a
>>>    hint by fsck.gfs2 when rebuilding a bad rindex, for example.
>>
>>
>> How is that better than a resource group size field that wouldn't need
>> to special case the last resource group?
>
>
> The last block of the mapped space in a resource group (ri_data0 + ri_data)
> is not necessarily at the block address immediately preceding the next
> resource group, due to device alignment and bitmap rounding. Also, if we
> assume we know the position of the first new resource group that would be
> created by gfs2_grow then we might get it wrong, so we can't set the final
> resource group's rg_skip to a useful value.

Okay, I can understand that it makes sense to leave alignment details
to mkfs / growfs.

Is it guaranteed that the kernel will never set the new rg_skip field
if it hasn't verified that the next resource group is where it thinks
it is? Otherwise we could end up with incorrect fsck "hints" for
corrupted filesystems, which would make things worse.

Thanks,
Andreas




More information about the Cluster-devel mailing list