On Fri, Nov 06, 2015 at 05:52:08PM +0530, Vishnu Pratap Singh wrote:
Have you even tried to trigger the failure exits you've added? The
more you've successfully set up, the _less_ your cleanup code ends
up undoing; that simply can't be right.
That aside, as soon as we'd done register_disk(), the damn thing is
available for open(), so bailing out is _really_ not something for
faint-hearted - it's essentially equivalent to removal of device under
somebody who'd opened it and might've started IO, etc. Going there
simply because some sysfs shite didn't get created doesn't look sane
as far as I'm concerned...
Especially since these failure exits are not going to be tested on
a regular basis, so the amount of bitrot will be pretty high ;-/