[stgt] [PATCH 0/2] tgt-admin: check if device is in use before allocating it

FUJITA Tomonori fujita.tomonori at lab.ntt.co.jp
Wed Oct 8 08:23:16 CEST 2008


On Tue, 07 Oct 2008 17:35:09 +0200
Doron Shoham <dorons at Voltaire.COM> wrote:

> FUJITA Tomonori wrote:
> > On Mon, 06 Oct 2008 16:59:08 +0200
> > Tomasz Chmielewski <mangoo at wpkg.org> wrote:
> > 
> >> Right now, tgt-admin looks into /etc/mtab, /proc/swaps etc. to determine 
> >>   if the device it wants to allocate is in use. This is a good way to 
> >> prevent the user from corrupting filesystems (i.e., mounting the device 
> >> locally to correct a config file, forgetting to unmount it, and 
> >> allocating it as a target), but unfortunately, it doesn't check all 
> >> kinds of "device-in-use" scenarios.
> >>
> >> The following patches add a full support for detecting "used devices":
> >> - used by the system: mounted, swap devices, parts of RAID array, LVM, 
> >> dm-crypt, etc.
> >> - used by userspace, i.e. dd, e2fsck, existing tgtd target etc.
> >>
> >> For "userspace" tests, lsof is needed. If it's not present, a warning 
> >> will be shown, informing the user that we can't check reliably if the 
> >> device is in use.
> >>
> >>
> >> The check can be overridden by using --force command line option or
> >> "allow-in-use yes" config option.
> > 
> > Sounds a reasonable option.
> > 
> > Doron, you wrote the patch to check device in use? Any comments on
> > this?
> > --
> 
> This sounds very reasonable but I didn't managed to test it yet.

Thanks,

I just wanted to know if you have objections against it (like the
fundamental idea is wrong, or there is a better name than
'allow-in-use', etc)

Working or not working is a different topic. If you find it's broken,
please send a patch to fix it. :)

Thanks,
--
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