Skip to contentSkip to conversation

f2fs: initialize page_array_entry slab only if compression feature is on

PATCH New Chao Yu 1 participant 1 message Jun 19, 2022 F2FS file system

lore
Share & tools
lore

Chao Yu

author maintainer
#0 lore raw

PATCH 1/1 f2fs: initialize page_array_entry slab only if compression feature is on

Otherwise, in image which doesn't support compression feature, page_array_entry will be initialized w/o use.

---
 fs/f2fs/compress.c | 3 +++
 1 file changed, 3 insertions(+)
fs/f2fs/compress.c +3 -0
index 24824cd96f36..fa237e5c7173 100644
@@ -1908,6 +1908,9 @@ int f2fs_init_page_array_cache(struct f2fs_sb_info *sbi)
 	dev_t dev = sbi->sb->s_bdev->bd_dev;
 	char slab_name[32];
 
+	if (!f2fs_sb_has_compression(sbi))
+		return 0;
+
 	sprintf(slab_name, "f2fs_page_array_entry-%u:%u", MAJOR(dev), MINOR(dev));
 
 	sbi->page_array_slab_size = sizeof(struct page *) <<
Signature · 1 line
2.36.1