Re: [PATCH] 2 of 2 - Allow O_EXCL on a block device to claim exclusive use.

From: viro
Date: Mon Aug 11 2003 - 22:10:41 EST


On Tue, Aug 12, 2003 at 04:56:10AM +0200, Andries Brouwer wrote:
> On Tue, Aug 12, 2003 at 11:48:28AM +1000, Neil Brown wrote:
>
> > My first attempt at this did claim before openning.
> > However that didn't work.
> > Some aspects of the bdev that are needed for claiming are not
> > initialised before it is first opened. In particular, bd_contains,
> > gets set up by do_open.
>
> Size and structure of partitions are entirely independent of whether
> someone has opened them. Thus, the corresponding bookkeeping must
> not be in struct block_device, which exists only when the device
> is open, but in struct gendisk or so (and only there).
>
> It is a design mistake to have such stuff in struct block device.

WTF does it have to do with ->bd_contains? We *do* have the information
you (and nobody else in this thread) are talking about - in gendisk.
Exclusion upon open, OTOH, has something with opening these beast, won't
you agree?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/