Re: attach SR drive by force even if not all chunks provide native metadata

2016-09-27 Thread Karel Gardas
On Tue, Sep 27, 2016 at 7:27 PM, Joel Sing  wrote:
> On Saturday 24 September 2016 00:13:47 Karel Gardas wrote:
>> Hello,
>>
>> following patch fixes issue while attempting to attach SR RAID1 drive
>> where not all chunks provide native metadata. I.e. one chunk is dd
>> zeroed. The complain of SR is good one, but I'd think that force
>> parameter should overcome it and really enforce SR to attach such
>> drive.
>
> I'll need to look more closely, but I'm pretty certain this is not correct -
> if there is no native metadata on the chunk, then it should not be considered
> to be part of the volume. In the case of an SR RAID1 volume, if you have a
> chunk that was zeroed, then you should be rebuilding on to it, rather than
> bringing it up as an existing part of the volume.

Thanks for reply, indeed, looking into the code more deeply and it
looks like the patch was working for me just by coincidence.



Re: attach SR drive by force even if not all chunks provide native metadata

2016-09-27 Thread Joel Sing
On Saturday 24 September 2016 00:13:47 Karel Gardas wrote:
> Hello,
> 
> following patch fixes issue while attempting to attach SR RAID1 drive
> where not all chunks provide native metadata. I.e. one chunk is dd
> zeroed. The complain of SR is good one, but I'd think that force
> parameter should overcome it and really enforce SR to attach such
> drive.

I'll need to look more closely, but I'm pretty certain this is not correct - 
if there is no native metadata on the chunk, then it should not be considered 
to be part of the volume. In the case of an SR RAID1 volume, if you have a 
chunk that was zeroed, then you should be rebuilding on to it, rather than 
bringing it up as an existing part of the volume.
 
> Thanks,
> Karel
> 
> diff -u -p -u -r1.377 softraid.c
> --- softraid.c  20 Jul 2016 20:45:13 -  1.377
> +++ softraid.c  23 Sep 2016 22:06:55 -
> @@ -1658,7 +1661,7 @@ sr_meta_native_attach(struct sr_discipli
> not_sr++;
> }
> 
> -   if (sr && not_sr) {
> +   if (sr && not_sr && !force) {
> sr_error(sc, "not all chunks are of the native metadata "
> "format");
> goto bad;



attach SR drive by force even if not all chunks provide native metadata

2016-09-23 Thread Karel Gardas
Hello,

following patch fixes issue while attempting to attach SR RAID1 drive
where not all chunks provide native metadata. I.e. one chunk is dd
zeroed. The complain of SR is good one, but I'd think that force
parameter should overcome it and really enforce SR to attach such
drive.

Thanks,
Karel

diff -u -p -u -r1.377 softraid.c
--- softraid.c  20 Jul 2016 20:45:13 -  1.377
+++ softraid.c  23 Sep 2016 22:06:55 -
@@ -1658,7 +1661,7 @@ sr_meta_native_attach(struct sr_discipli
not_sr++;
}

-   if (sr && not_sr) {
+   if (sr && not_sr && !force) {
sr_error(sc, "not all chunks are of the native metadata "
"format");
goto bad;