[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20231109213348.675704-1-daeho43@gmail.com>
Date: Thu, 9 Nov 2023 13:33:48 -0800
From: Daeho Jeong <daeho43@...il.com>
To: linux-kernel@...r.kernel.org,
linux-f2fs-devel@...ts.sourceforge.net, kernel-team@...roid.com
Cc: Daeho Jeong <daehojeong@...gle.com>
Subject: [PATCH] f2fs-tools: initialize user cache valid values
From: Daeho Jeong <daehojeong@...gle.com>
Need to initialize user cache valid values to prevent from providing
false cache entries.
Signed-off-by: Daeho Jeong <daehojeong@...gle.com>
---
lib/libf2fs_io.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/libf2fs_io.c b/lib/libf2fs_io.c
index 39d3777..d76da83 100644
--- a/lib/libf2fs_io.c
+++ b/lib/libf2fs_io.c
@@ -165,7 +165,7 @@ static int dcache_alloc_all(long n)
|| (dcache_lastused = (uint64_t *)
malloc(sizeof(uint64_t) * n)) == NULL
|| (dcache_buf = (char *) malloc (F2FS_BLKSIZE * n)) == NULL
- || (dcache_valid = (bool *) malloc(sizeof(bool) * n)) == NULL)
+ || (dcache_valid = (bool *) calloc(sizeof(bool) * n, 1)) == NULL)
{
dcache_release();
return -1;
--
2.42.0.869.gea05f2083d-goog
Powered by blists - more mailing lists