mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] erofs: clean up the cache if cached decompression is disabled
@ 2024-11-12  3:15 Chunhai Guo
  2024-11-12  3:09 ` Gao Xiang
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Chunhai Guo @ 2024-11-12  3:15 UTC (permalink / raw)
  To: xiang
  Cc: chao, huyue2, jefflexu, dhavale, linux-erofs, linux-kernel, Chunhai Guo

Clean up the cache when cached decompression strategy is changed to
EROFS_ZIP_CACHE_DISABLED by remount.

Signed-off-by: Chunhai Guo <guochunhai@vivo.com>
---
 fs/erofs/super.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/fs/erofs/super.c b/fs/erofs/super.c
index 320d586c3896..de2af862e65b 100644
--- a/fs/erofs/super.c
+++ b/fs/erofs/super.c
@@ -743,6 +743,11 @@ static int erofs_fc_reconfigure(struct fs_context *fc)
 	else
 		fc->sb_flags &= ~SB_POSIXACL;
 
+	if (new_sbi->opt.cache_strategy == EROFS_ZIP_CACHE_DISABLED) {
+		mutex_lock(&sbi->umount_mutex);
+		z_erofs_shrink_scan(sbi, ~0UL);
+		mutex_unlock(&sbi->umount_mutex);
+	}
 	sbi->opt = new_sbi->opt;
 
 	fc->sb_flags |= SB_RDONLY;
-- 
2.34.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-11-12 11:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-12  3:15 [PATCH] erofs: clean up the cache if cached decompression is disabled Chunhai Guo
2024-11-12  3:09 ` Gao Xiang
2024-11-12 10:39 ` kernel test robot
2024-11-12 11:42 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®