Re: problem with device validation

denis bonnenfant <[email protected]>
Newsgroups gmane.linux.enbd.general
Message-ID <[email protected]>
Peter T. Breuer a écrit :
> "Also sprach denis bonnenfant:"
> 
>>I have a problem with nbd device validation before adding it to fr1 array :
>>
>>to be assembled, nbd device has to be validated. But i haven't found a reliable 
> 
> 
> I'm not sure I know what you mean by "validated".
> 
> If you mean the flag in the nbdinfo status line ...

yes
> 
> 
>>Device a:       Open
>>[a] State:      verify, rw, enabled, validated, show_errs, last error 0, lives 
> 
> 
> Then that's the ENBD_VALIDATED flag
> 
>      atomic_read (&lo->flags)
>            & ENBD_VALIDATED ? "validated, " : "",
> 
> which is set after a partition check has been done on the device, which
> is to say that sector zero has been read and parsed by the kernel.
> 
> If you have no reason to check for partitions, you can disable the
> check. It's a nuisance anyway, since there's a race in doing it - the
> kernel needs the partition layout to authorise accesses to minors,
> but we are talking through the minors via the daemons ... for that
> reason the damons fall back to talking through the whole disk device 
> using special auth codes if they can't talk through the minor devices.
> 
> You can disable the check by unsetting the ENBD_CHECK_PARTITIONS flag.
>
> That's the "check_partitions" flag in the status line. I see you don't
> have it set anyway, hence no partition check will be done. So I don't
> think the validated flag means anything.
> 
> Why are you interested in it?

in fact, the problem occurs in this situation :
- primary has been stopped.
- on secondary, enbd-client is running, but connection with server is lost
- raid is started on secondary with only the local disk.
- primary starts
- enbd-server is started on primary by init script. connexion is established 
with client.
- when i try to hotadd nbd device to secondary raid, sometimes it fails to read 
nbd superblock. I found that waiting nbd to be marked validated in nbdinfo 
solves the problem. But maybe it's a wrong diagnosis and there is a better way 
to be sure that enbd device is useable?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.