[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: locking devices and partitions in partman



On Wed, Jun 07, 2006 at 01:00:22AM +0200, Frans Pop wrote:
On Wednesday 07 June 2006 00:29, David Härdeman wrote:
I'd love to hear some comments on this approach.

One problem I see at first glance is one of translation: you cannot hardcode a string like "In use by LVM VG $vg" for $MESSAGE, unless you really want all translators (led by Christian) coming after you with a heavy cluebat...

Yes, yes, translatable strings is something I'll fix in the timespan between post-proof-of-concept and pre-svn-commit but definately before the perrier-grabs-his-+5-cluebat-of-smiting era.

Are there cases where there could be multiple locks on the same device/partition? The current code does not seem to support this.

It doesn't support multiple locks per device or partition. I'm not able to come up with a situation where it would be needed though...a device or partition being used by several subsystems simultaneously does sound a bit weird to my limited brain.

The function names look potentially confusing too as (un)lock_device can be used for both devices and partitions.

Ok...how about partman_(un)lock_unit? I'm not sure about the naming since it should convey the fact that the function is to be used both for devices and partitions....

Would it not be cleaner to also pass the partition as a parameter instead of using $id? Are you sure that will always be set correctly?

Ok, I'll separate the two

Is it correct that a device gets unlocked if there are partitions on it that are still locked (partitions other than the current one being unlocked)?

No, the partition and device locking are independent. So if you do something which locks the device (e.g. create a md-raid device using a partition from the device...once you've done that, the kernel won't let you repartition the underlying disk as its regarded as "in use") you have to revert that for the device lock to be removed (that's the theory at least).

In reality I'd guess that you'll have either device locks *or* partition locks in 99% of all cases.

Regards,
David



Reply to: