[lkml]   [2000]   [Sep]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: ext2 caches
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?" -- Dogbert
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 12:39    [W:0.048 / U:1.368 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site