From 71669d0541f0d3db64792c60a28abddba78382e2 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Thu, 23 Dec 2004 21:49:05 -0500 Subject: [PATCH] Avoid some potential inode cache coherency problem caused by using the byte-swapping options to e2fsck. This was the cause of some hard to reproduce problems that had been reported in the past, and which the resize_inode changes tickled in a much more repeatable fashion. --- e2fsck/ChangeLog | 6 ++++++ e2fsck/swapfs.c | 1 + lib/ext2fs/ChangeLog | 3 +++ lib/ext2fs/inode.c | 1 + 4 files changed, 11 insertions(+) diff --git a/e2fsck/ChangeLog b/e2fsck/ChangeLog index 78be211..d6df0ec 100644 --- a/e2fsck/ChangeLog +++ b/e2fsck/ChangeLog @@ -1,3 +1,9 @@ +2004-12-23 Theodore Ts'o + + * swapfs.c (swap_inodes): Since swap_inodes bypasses the inode + cache for speed reasons, we must flush it to avoid cache + coherency problems. + 2004-12-16 Theodore Ts'o * super.c (check_super_block): If the resize_inode feature is not diff --git a/e2fsck/swapfs.c b/e2fsck/swapfs.c index 3e7609b..8d46404 100644 --- a/e2fsck/swapfs.c +++ b/e2fsck/swapfs.c @@ -182,6 +182,7 @@ static void swap_inodes(e2fsck_t ctx) ext2fs_free_mem(&buf); ext2fs_free_mem(&block_buf); e2fsck_use_inode_shortcuts(ctx, 0); + ext2fs_flush_icache(fs); } #if defined(__powerpc__) && defined(EXT2FS_ENABLE_SWAPFS) diff --git a/lib/ext2fs/ChangeLog b/lib/ext2fs/ChangeLog index f2ce518..3d8f435 100644 --- a/lib/ext2fs/ChangeLog +++ b/lib/ext2fs/ChangeLog @@ -1,5 +1,8 @@ 2004-12-23 Theodore Ts'o + * inode.c (ext2fs_flush_icache): When flushing the icache, clear + the last-read block information as well. + * ext2fs.h (BMAP_SET), bmap.c (ext2fs_bmap): Add support for new flag, BMAP_SET, which allows the caller to set a particular logical->physical block mapping. diff --git a/lib/ext2fs/inode.c b/lib/ext2fs/inode.c index a1179d2..d0de254 100644 --- a/lib/ext2fs/inode.c +++ b/lib/ext2fs/inode.c @@ -63,6 +63,7 @@ errcode_t ext2fs_flush_icache(ext2_filsys fs) for (i=0; i < fs->icache->cache_size; i++) fs->icache->cache[i].ino = 0; + fs->icache->buffer_blk = 0; return 0; } -- 1.8.3.1