[stgt] [PATCH 2/2] tgt-admin: check if device is mounted on /
mangoo at wpkg.org
Tue Sep 2 13:57:03 CEST 2008
Eli Dorfman schrieb:
> On Mon, Sep 1, 2008 at 4:31 PM, Tomasz Chmielewski <mangoo at wpkg.org> wrote:
>> Doron Shoham schrieb:
>>> check if device is mounted on / before allocating it
>> I'm not very familiar with distributed filesystems, like GFS2 or OCFS2 - but
>> what if someone wants to use them?
>> Can't it be that in such case underlying device is mounted on the target as
> In any case target's system disk should not be allocated to the initiator.
> The purpose of this patch is to deny such allocation.
Generally, any filesystem mounted on the target should not be allocated
to initiators. Disallowing / (i.e., /dev/sda1), but allowing /usr (i.e.,
/dev/sda2) or swap is certainly not a good idea.
The info can be fetched from /etc/mtab (unless we have a system with
read-only /etc, where /etc/mtab could be a link to /proc/mounts - I
think /proc/mounts doesn't always show an underlying device where rootfs
sits). Also, parsing /proc/swaps would be useful.
But what if someone has rootfs on /dev/mtd0, mtd0 consists of /dev/sda1
and /dev/sdb1 - and wants to allocate /dev/sdb to initiators? Not to say
LVM, dm-crypt devices, etc... - it looks like there are lots of
possibilities for an admin to break the system ;)
If someone is brave (or uses a distributed fs on the target) and really
wants to allow initiators access to a mounted filesystem, we could add a
separate option for that ("allow-mounted")?
Although I guess it wouldn't have many users today.
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