Re: ext2 caches

From: Andreas Dilger (adilger@turbolinux.com)
Date: Fri Sep 29 2000 - 13:11:58 EST


Fred and Tom write:
> We would like to do some operations on a ext2 disk while it is mounted
> read-only. The problem is that our operations have no effects because
> everithing is cached.
> Is it possible to shrink all the caches, especially the superblock
> caches and to reload the changes?

It is not possible to free the superblock without unmounting the filesystem.
However, ext2 stores a lot of the superblock directly in the buffer cache
so you _could_ modify it in user-space and it would appear in the kernel.
This is the u.ext2_sb.s_es->s_* data (struct ext2_super_block).

However, anything that is in u.ext2_sb.s_* (struct ext2_sb_info) is stored
in the in-memory superblock, and is not accessible from user-space.
You need to write an ioctl, or a remount operation (like I do with my
online ext2 resizer) in order to change these fields.

Since you are using a read-only mounted fs, you don't have problems
with other programs changing the fs at the same time, but it is still
dangerous to change the superblock directly like this. Once you can
mount read-only, can you not also simply unmount the fs? What is it
you are trying to do?

Cheers, Andreas

-- 
Andreas Dilger  \ "If a man ate a pound of pasta and a pound of antipasto,
                 \  would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/               -- Dogbert
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Sep 30 2000 - 21:00:25 EST