[stgt] [PATCH 2/2] tgt-admin: check if device is mounted on /

Tomasz Chmielewski mangoo at wpkg.org
Wed Sep 10 10:38:21 CEST 2008

FUJITA Tomonori schrieb:
> On Wed, 10 Sep 2008 09:21:41 +0300
> Doron Shoham <dorons at Voltaire.COM> wrote:
>> FUJITA Tomonori wrote:
>>> On Thu, 04 Sep 2008 16:39:24 +0300
>>> Doron Shoham <dorons at Voltaire.COM> wrote:
>>>> deny allocation of a device which
>>>> which mounted on the same device as rootfs.
>>>> also deny the allocation of swap devices.
>>>> add --allow-mounted flag for overriding this.
>>> Do we really need a new option? Using the --force option is better for
>>> me.
>> As I understand, --force option has a different rule when using it with --execute.
>> "The patch also changes the behaviour of --execute slightly - it now
>>  tries to delete the targets which are not in the config file; if the
>>  target is in use, it won't be touched (unless --force is used); if the
>>  target is not in use, it will be deleted."
>> So if we use it for allow-mounted also it can be ambiguous.
> Hmm, for me, the force option always means that we do things that we
> don't do by default and just give warning of.
> For your change, without '--force', if an user tries to use a mounted
> device, the tool gives warning of it and ignores the device.
> With '--force', the tool uses any device even if it's mounted.
> For me, it's pretty consistent. Anyone?

Of course there can be another possibility ;)

*Perhaps* it's a good idea if we don't allow to override config file 
options with command line options.

So, if we want to allow a given (mounted, in use) device to be made a 
target, say so in the config file explicitly:

<target ...>
    allow-mounted yes

This way, one has to think twice before making a potentially dangerous 

Tomasz Chmielewski
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

More information about the stgt mailing list