[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.01.0907281333490.3186@localhost.localdomain>
Date: Tue, 28 Jul 2009 13:50:56 -0700 (PDT)
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Andi Kleen <andi@...stfloor.org>
cc: Kyle Moffett <kyle@...fetthome.net>,
Alan Cox <alan@...rguk.ukuu.org.uk>,
Zachary Amsden <zamsden@...hat.com>, Tejun Heo <tj@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
linux-kernel@...r.kernel.org, axboe@...nel.dk, hch@...radead.org,
akpm@...ux-foundation.org, Paul.Clements@...eleye.com,
tytso@....edu, miklos <miklos@...redi.hu>
Subject: Re: [PATCH] Allow userspace block device implementation
On Tue, 28 Jul 2009, Andi Kleen wrote:
> Kyle Moffett <kyle@...fetthome.net> writes:
> >
> > (1) The ability to rearrange, resize, and restructure
> > partition-tables on the fly. The existing "re-read partition tables"
> > infrastructure does not safely and reasonably handle changes to the
> > partition-table while partitions are mounted.
>
> It doesn't today (and I really hate it too), but is there a hard reason it
> couldn't be fixed to support that properly?
If something has a partition open (and it doesn't really even have to be a
mounted filesystem, altough that's obviously the most relevant case), how
can you reasonably change the partition from underneath it? So I assume
you mean that partitions were opened earlier (for a mount) would not be
touched.
And these days, that _should_ just work. The "reread partition table"
operation should just leave the old bdev's around (so a mounted filesystem
simply won't _see_ the new partitions, but will continue to use the old
one), and for all I know that might even work these days.
[ Here "these days" is admittedly only in comparison to the _original_
Linux code, which used block numbers. Many years ago. ]
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.
So I think re-reading the partition tables should be safe these days. It
definitely didn't _use_ to be the case due to dev_t issues, but that's
really ancient.
It may be that we just have the old check in place ("don't allow
re-reading if something has mounted a partition"), and we could just get
rid of it. I have not looked.
But if you actually meant that re-reading the partition table should
_change_ a "struct block_dev" that is in use, then I think that would be a
bad idea. At the very least, it should involve a re-mount or something.
Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists