Re: [PATCH] Allow userspace block device implementation

From: Theodore Tso
Date: Tue Jul 28 2009 - 18:57:32 EST


On Tue, Jul 28, 2009 at 01:50:56PM -0700, Linus Torvalds wrote:
>
> Filesystems long ago _used_ to index things by device number and block -
> and that meant that re-reading partition tables was _really_ dangerous,
> because the "device number" would just magically mean something else for a
> mounted filesystem. But we've indexed things by bdev for a longish time
> now, and most (all?) filesystems use "sb_bread()" instead of bread etc.

Filesystems don't, but some userspace programs do depend on the dev_t
returned by stat to uniquely identify a mounted filesystem. (And it's
guaranteed by POSIX). So what this means is that if we're going to
allow re-reading the partition table, we should (a) avoid changing the
dev_t used by any mounted filesystem, and (b) we should either assign
a new dev_t for any new partitions, or we should disallow mounting a
filesystem with a new dev_t already in use by an already mounted
filesystem with the same dev_t before the partition table was
reorganized.

- Ted
--
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/