On 02/10/13 07:31, Stefan Sperling wrote:
On Sun, Feb 10, 2013 at 11:18:50PM +1100, Joel Sing wrote:
On Sun, 10 Feb 2013, Scott McEachern wrote:
Moving this to tech.
I tested the patch found at
http://marc.info/?l=openbsd-tech&m=133513662106783&w=2 and can give you
some results.
As you've already discovered, that diff is broken. BIOCVOL does not behave how
the diff assumes - it will return the volume specified by the bv_volid field
in the bioc_vol struct. Since this is never initialised you'll effectively
get a random volume returned (based on stack garbage). This is arguably a
design flaw in bio(4), which softraid could work around (basically we want to
identify the volume whose device we opened, not the softraid controller).
Back when I wrote it I only tested with physical disk device names,
not softraid volumes. It seemed to work reliably, though that might
have been pure luck.
Thanks for pointing out that the bio(4) interface doesn't behave as
I expected. If I find time I might try to write a proper diff for this,
but for now it's not high on my todo list. I don't use stacked raid
volumes. For my needs passing a disk device name to bioctl is good enough.
It was worth a shot, and I'll be around to test whenever someone decides
to take another stab at it.
On the bright side, I learned something new about how bioctl(8)
behaves. Namely, that I can "safely" destroy volumes and easily bring
them back. And I only had to change my underwear once! :)
--
Scott McEachern
https://www.blackstaff.ca