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

Tomasz Chmielewski mangoo at wpkg.org
Mon Oct 6 16:59:08 CEST 2008


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.



-- 
Tomasz Chmielewski
http://wpkg.org
--
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