Comment 55 for bug 484429

Revision history for this message
In , David (david-redhat-bugs) wrote :

(In reply to comment #1)
> Well, the problem is exacltly defined.
>
> But if devkit-disks/udisks create the mapping in reaction of inserting device
> event, it should also handle removal of device.

Right - I thought we already handled the force_unmount + luks_teardown but perhaps it broke some time ago. Anyway, the general problem is tracked here

 http://bugs.freedesktop.org/show_bug.cgi?id=24279

and it asks to automatically Do The Right Thing(tm) for devices set up via udisks (and only for devices set up via udisks).

(And if I've learned anything the past half decade where I've been working on these things... is that it can be very dangerous to automatically do things like this (the same way that it's very dangerous to automount and autoassemble based on signatures). So that's why I'm keen on automatically cleaning up only after things set up via udisks.)

> Maybe I can add some --force option to cryptsetup, which remove all existing
> (or dead) crypt mapping of previous instance of newly appeared device.
>
> But cryptsetup cannot handle
> - force unmounting possible FS (it is another level, cryptsetup have no idea
> about FS)
> - trigger any event on device removal (cryptsetup is just binary to create
> mapping, someone must add some rule which run it - here udisks I guess?)
>
> I am reassigning this to udisks, but there is probably some part where
> cryptsetup can help, not sure. Please let me know if you have such request...

I think it's probably wrong to make cryptsetup, mount, mdadm, lvm etc. worry about this - such cleaning up is generally considered "policy".