]> err.no Git - linux-2.6/commit
uml: handle block device hotplug errors
authorJeff Dike <jdike@addtoit.com>
Sun, 6 May 2007 21:51:01 +0000 (14:51 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Mon, 7 May 2007 19:13:00 +0000 (12:13 -0700)
commitb47d2debf229469c78af4145ee7ad35a0f21b67f
tree6bca064260d56701b799282b40586277278996b4
parent1d94cda04eb82feb87c932ac3d4aef1e9dc78a43
uml: handle block device hotplug errors

If a disk fails to open, i.e.  its host file doesn't exist, it won't be
removable because the hot-unplug code checks the existence of its gendisk.
This won't exist because it is only allocated for successfully opened disks.
Thus, a typo on the command line can result in a unusable and unfixable disk.

This is fixed by freeing the gendisk if it's there, but not letting that
affect the removal.

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/um/drivers/ubd_kern.c