[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1586342714-12536-7-git-send-email-wangshilong1991@gmail.com>
Date: Wed, 8 Apr 2020 19:44:34 +0900
From: Wang Shilong <wangshilong1991@...il.com>
To: linux-ext4@...r.kernel.org
Cc: lixi@....com, adilger@...ger.ca, sihara@....com,
Wang Shilong <wshilong@....com>
Subject: [RFC PATCH 06/46] e2fsck: clear icache when using multi-thread fsck
From: Li Xi <lixi@....com>
icache of fs will be rebuilt when needed, so after copying
fs, icache can be inited to NULL.
Signed-off-by: Li Xi <lixi@....com>
Signed-off-by: Wang Shilong <wshilong@....com>
---
e2fsck/pass1.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c
index baf720ce..599c69aa 100644
--- a/e2fsck/pass1.c
+++ b/e2fsck/pass1.c
@@ -2120,6 +2120,13 @@ static errcode_t e2fsck_pass1_copy_fs(ext2_filsys dest, ext2_filsys src)
dest->inode_map->fs = dest;
if (dest->block_map)
dest->block_map->fs = dest;
+
+ /* icache will be rebuilt if needed, so do not copy from @src */
+ if (src->icache) {
+ ext2fs_free_inode_cache(src->icache);
+ src->icache = NULL;
+ }
+ dest->icache = NULL;
return 0;
}
@@ -2134,6 +2141,13 @@ static void e2fsck_pass1_merge_fs(ext2_filsys dest, ext2_filsys src)
dest->inode_map->fs = dest;
if (dest->block_map)
dest->block_map->fs = dest;
+
+ /* icache will be rebuilt if needed, so do not copy from @src */
+ if (src->icache) {
+ ext2fs_free_inode_cache(src->icache);
+ src->icache = NULL;
+ }
+ dest->icache = NULL;
}
static errcode_t e2fsck_pass1_thread_prepare(e2fsck_t global_ctx, e2fsck_t *thread_ctx)
--
2.25.2
Powered by blists - more mailing lists