Skip to contentSkip to conversation

fsck.f2fs: avoid randomness in sum_blk

PATCH New Theotime Combes via Linux-f2fs-devel 1 participant 1 message Jul 15, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fsck.f2fs: avoid randomness in sum_blk

This patch removes random bytes in sum_blk when loading a new directory.

---
 fsck/mount.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fsck/mount.c +2 -2
index c63e8d1..a54abc4 100644
@@ -1940,9 +1940,9 @@ static int build_curseg(struct f2fs_sb_info *sbi)
 	SM_I(sbi)->curseg_array = array;
 
 	for (i = 0; i < NR_CURSEG_TYPE; i++) {
-		array[i].sum_blk = malloc(PAGE_CACHE_SIZE);
+		array[i].sum_blk = calloc(PAGE_CACHE_SIZE, 1);
 		if (!array[i].sum_blk) {
-			MSG(1, "\tError: Malloc failed for build_curseg!!\n");
+			MSG(1, "\tError: Calloc failed for build_curseg!!\n");
 			goto seg_cleanup;
 		}
 
Signature · 8 lines
2.27.0.389.gc38d7665816-goog



_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel