Messages in this thread | | | Date | Tue, 19 Apr 2011 07:42:55 -0400 | From | Ted Ts'o <> | Subject | Re: Linux 2.6.39-rc3 |
| |
On Mon, Apr 18, 2011 at 07:02:55PM -0400, Dave Jones wrote: > > Your code looks like you copy the bytes to the in-kernel superblock > > structure without noticing any later changes on disk? How is that > > supposed to work? > > I thought tune2fs on a mounted filesystem was always a > "you get to keep both pieces if it breaks" situation.
It's actually something that we've supported for a long time, and we go to some lengths to make it be safe. Ext[234] always directly checks things that could be safely changed by tune2fs directly in the buffer cache where the superblock is stored, and tune2fs checks to see if the file system is mounted, and (a) will refuse to make certain changes that are unsafe, and (b) make the changes to the buffer cache by seeking to the right place in the superblock and only writing the 1/2/4 bytes which are needed to make the change.
So it is something that we've advertised will work, although some changes only take effect when the file system is mounted and remounted, even if you are allowed to make the change while the file system is mounted. The best known example of this is being able to on-line convert a mounted root file system to add a journal. You can do that while it is mounted, but you have to reboot and/or mount/remount the file system in order for the journal to start getting used.
- Ted
| |