[patch] resize and recover support for GPART GPT scheme

Andrey V. Elsukov bu7cher at yandex.ru
Fri Apr 23 04:36:09 UTC 2010


On 23.04.2010 0:53, Andriy Gapon wrote:
>> There are several things that can be do where i need suggestions.
>> 1. What code should do when user doing `gpart recover` for scheme
>> that doesn't need recovering?
>
> Do you mean the schemes that do not support recovery (like MBR)?  The answer is
> obvious.
> If you mean GPT in OK state, when both copies are correct, then the code could
> just return success and, perhaps, some diagnostic message.

Schemes that do not support recovery will return ENOSYS. Currently `gpart recover`
will write metadata each time when user calls it. To prevent this behavior needed
something similar ENOTNEEDED :)

>> 2. Probably there are needed some checks before changing metadata in
>> g_part_gpt_recover method.
>>
>> So, patch attached and comments are welcome.
>
> Without deep analysis the patch looks good.

Actually this was an implementation of `reinit` verb, but after some thinking i
decided to make it as `recover` verb. And in this case using AlternateLBA is not
needed. At this time it may be usable only for reporting that secondary table
is not located at the last LBA.

> Just to be sure - it handles the case when primary table is corrupt but the
> secondary (at the end of media) is OK?

Yes.

> I will try to fully review your patch a little bit later.

Thank you, but i still wait what Marcel will say about this patch
and several others.

-- 
WBR, Andrey V. Elsukov


More information about the freebsd-geom mailing list