Comment 22 for bug 38409

Revision history for this message
Fabio Massimo Di Nitto (fabbione) wrote :

Speaking with one of the upstream guys:

<fabbione> pjc: do you mind to give me an opinion on https://launchpad.net/distros/ubuntu/+source/lvm2/+bug/38409/ ?
<pjc> what's happening here is that LVM creates the snapshot LV,
<pjc> temporarily activates it to zero the start (so the kernel knows its a new snapshot)
<pjc> then deactivates it (which fails because udev is using it)
<pjc> then wants to reactivates the whole LV/snapshot stack.
<pjc> ...the last bit desn't happen because the deactivate failed.
<fabbione> ooook
<fabbione> so my next natural question is why udev and lvm need to do the same device handling, overlapping and racing?
<pjc> well, they're doing different things,
* fabbione scratches his head...
<fabbione> i can understand what LVM is doing and why
<pjc> hmm, maybe they're not.
<fabbione> 2 things i can't really explains:
<pjc> I suppose LVM maybe ought to wait for udev to create the device, ... maybe
<fabbione> 1) why lvm takes care of creating devices when there is udev
<fabbione> 2) if lvm really needs to manage it's own temporary devices, why can't it do outside the /dev tree?
<pjc> I suppose 1) is historical, there wasn't always udev
<pjc> 2) is a good point.
<fabbione> 1) i agree
<fabbione> 2) i know :P
<fabbione> i wonder how much it would break to do 2)
<pjc> the thing about 2) is, how to do stop udev interfering? If devmapper creates a block device, how to we stop udev inerfering
<pjc> it might be easier to just flag it somehow.
<pjc> as a temp device
<fabbione> if we move temporary devices to /whatevertmpdir, the final device will be created by udev on kernel/devmapper input
<fabbione> so there should be cooperation and not interference at that point
<pjc> agk won't like that I guess, it means breaking the LVM/libdevmapper API /again/
<fabbione> i don't the API but if internal temporary devices are *really* internal and temporary and not exposed to the client, then i don't see how that would break the API
<fabbione> i don't *know the API ^^
<fabbione> just a wild guess
<fabbione> you know the code.. i don't
<pjc> LVM tells libdevmapper to create the device, then LVM uses it. then it tells libdevmapper to deactivate the device
<pjc> so (and I'm guessing a little here) there would need to be a flag saying it's temporary
<fabbione> does lvm also tells libdevmapper the path to the device?
<pjc> I'm not /that/ familiar with the lvm/devmapper interface, it's a bit of a black art.
<pjc> I'm not sure.
<fabbione> yeah i can imagine
<fabbione> oh sorry i forgot to ask you.. do you mind if i copy/paste to the bug for reference?
<fabbione> otherwise i will write a short summary
<pjc> go ahead. agk is really the guy to tackle about this. but he's terrifyingly busy
<fabbione> i am not surprised about that either
<fabbione> i think i can work on it enough to look at the API at least
<fabbione> perhaps it's much easier than it looks like
<pjc> it isn't
<fabbione> it's still worth a shot :)
<fabbione> thanks a lot dude