* [f2fs-dev] [PATCH] f2fs-tools: initialize user cache valid values
@ 2023-11-09 21:33 Daeho Jeong
0 siblings, 0 replies; only message in thread
From: Daeho Jeong @ 2023-11-09 21:33 UTC (permalink / raw)
To: linux-kernel, linux-f2fs-devel, kernel-team; +Cc: Daeho Jeong
From: Daeho Jeong <daehojeong@google.com>
Need to initialize user cache valid values to prevent from providing
false cache entries.
Signed-off-by: Daeho Jeong <daehojeong@google.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
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2023-11-09 21:34 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-09 21:33 [f2fs-dev] [PATCH] f2fs-tools: initialize user cache valid values Daeho Jeong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).