Re: [PATCH] kill-subarray: fix, cannot kill-subarray with unsupported metadata

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Sep 6, 2011 at 9:31 PM, NeilBrown <neilb@xxxxxxx> wrote:
> On Tue, 6 Sep 2011 12:16:43 -0700 "Williams, Dan J"
> <dan.j.williams@xxxxxxxxx> wrote:
>
>> On Mon, Sep 5, 2011 at 7:23 AM, Labun, Marcin <Marcin.Labun@xxxxxxxxx> wrote:
>> > Subject: [PATCH] kill-subarray: fix, cannot kill-subarray with unsupported metadata
>> >
>> > container_content retrieves volume information from disks in the container.
>> > For unsupported volumes the function was not returning mdinfo. When all volumes
>> > were unsupported the function was returning NULL pointer to block actions on the volumes.
>>
>> Isn't this the purpose of ->ignore_hw_compat?
>>
>> So we could do something simpler like the following instead?
>>
>> diff --git a/Kill.c b/Kill.c
>> index b841a5b..11b27a6 100644
>> --- a/Kill.c
>> +++ b/Kill.c
>> @@ -97,7 +97,9 @@ int Kill_subarray(char *dev, char *subarray, int quiet)
>>
>>         memset(st, 0, sizeof(*st));
>>
>> +       st->ignore_hw_compat = 1;
>>         fd = open_subarray(dev, subarray, st, quiet);
>> +       st->ignore_hw_compat = 0;
>>         if (fd < 0)
>>                 return 2;
>
> While that is a *much* nicer patch, I don't think it will actually address
> the problem.
> You would at least need container_content_imsm to ignore
> imsm_check_attributes if ->ignore_hw_compat was set.
>
> However I think things are getting a bit messy here and need to be cleaned up.
>
> Marcin's patch has the advantage that it treats the existence of a bad block
> log and incompatible attributes in much the same way.
> However I don't like:
>  - the increase in number of magic flag bits
>  - the editing of the list of arrays returned by container_content
>  - the error messages being printed by super-intel.c
>
> I think I would like:
>  - container_content always returns info about all arrays, so Examine and
>   Kill can work properly
>  - it sets a single flags (MD_SB_INVALID??) to say that the array cannot be
>   assembled or manipulated, and maybe stored a message string in the 'info'
>   so that common code can print it when it choses to ignore an array
>  - common code checks and ignores MD_SB_INVALID arrays as needed rather than
>   having them be removed from the list.
>
> Reasonable??

Yes, it would be nice to have a unified interface for reporting
"please, don't assemble this because: foo" while also giving as much
other info about the configuration as possible.

Where foo is:
"configuration crosses hardware domain boundary"
"platform/metadata is using feature X that mdadm does not support"
"raid array cannot be assembled without potentially exposing corrupted data"

Then --force can uniformly override those concerns, probably for
"Create" operations as well, but --force already has other meanings
there.

The ->ignore_hw_compat approach had the small beneficial side effect
of whitelisting approved usages of potentially invalid information,
but it should be no big deal to ensure those all get covered.
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux