to maintain integrity, use the new is-busy property to refuse service
authorDavid Zeuthen <davidz@redhat.com>
Tue, 25 Mar 2008 00:33:55 +0000 (20:33 -0400)
committerDavid Zeuthen <davidz@redhat.com>
Tue, 25 Mar 2008 00:33:55 +0000 (20:33 -0400)
commit6a2a1f2b7cc7b52b277aa9788a3a0bb280227441
tree933c4301ae3cf98d6b4a94001dc1298ee1cca8ac
parent46ec8d90830bce12af43d40318ca21cdc088818d
to maintain integrity, use the new is-busy property to refuse service

For example, we now throw the .IsBusy exception on CreatePartitionTable()
if one of the existing partitions is busy.

Prior to this patch we'd happily create a new partition table even
though a dm-crypt target were holding one of the partitions. Which
broke in interesting ways when we issued BLKRRPART. This is because
the kernel is rather dumb and BLKRRPART won't work if any of the
partitions are busy.

The solution, I think, involves judicious use of the "add partition"
and "del partition" ioctls to spoonfeed the kernel this information.
Will try and do this next. As an upside, I think the annoying "remove
all partitions, then add them back again" artifact will go away with
this. So maybe it's all good. We'll see.
src/devkit-disks-device.c
src/devkit-disks-device.h