From patchwork Thu Nov 9 21:33:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daeho Jeong X-Patchwork-Id: 163605 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b129:0:b0:403:3b70:6f57 with SMTP id q9csp719991vqs; Thu, 9 Nov 2023 13:33:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IGNFXF8yDXaNib7R77U5sqwNOXT/11f7SxTS7I5V5PcdMtusngWKGW3vXIhfKiSu6ophGUQ X-Received: by 2002:a05:6808:2e8a:b0:3b2:e60d:27f6 with SMTP id gt10-20020a0568082e8a00b003b2e60d27f6mr3307810oib.29.1699565638931; Thu, 09 Nov 2023 13:33:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699565638; cv=none; d=google.com; s=arc-20160816; b=oTdz+BdS/G6aPZWe0EQa2Ml3aFt+VzM+2dw4+64hoMafDqCLoznOUHjzgp1VM2vW0H 73O6Ywu/GuN7+hcXpJgMtfJ5Lg7iPN1LxRMZVxSOXqVa++T/DRc5HqkeaNPGcMNQMnha i7ygfu6fF1zsB4L9Zesua0WuCKx67gV0F/D/A8XopvhiQYLhMbeBXIZUiLfmJp2QPHQ8 yRyDB/UoGinTfbi+HGoWgMbDHYFQRziALDfUyWE2vmqevtiRNMDOn+mgRcYyzRo8byBb foPS2DKObooug8kkItcdJQLggE70IAMiVS4o/yqO2qTOsm9umxvspAHylY49d1zngEP6 MpdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=/unuH/wgOv+LMXS1Iv/n0xTf2dbEARyI1vRnvxRKBR4=; fh=IvJDhn2XbJ55zxf0p/e9A+SWoPpre/ymwh9Q/MPTdCg=; b=O5KF/kjhtftj4YzVinKNyqiUPbLCP4MTzACMh7yAY+B9YGZvnUprhojWX4oilsL3Vi 5AiRIOG333Suryc8JKI84n3Z6JPLh3/i7gZNEDW+FxfV2L4/99FJ+vmi2SqLEMyl5+hE xvQahre24+R/fLEsIiZ3902/kW+19JWBnI/z4HrDR1GtWBLVIiRV7krZJ38ZG/T2xhhv qMyaq4js/eiehoxlblCdB5Fbpn2w4/I0TXKVgJAUnYNiwCERBNwF6CzAWj8b7b5Q9kns KsFrvaMtJL2jnx6/HX9PqVdZwFkvqAYhJQWdEUVpSICD0FP2Yg0whnAvVnfMN7tyQfeY Y5OA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Uh6kWNv8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id j184-20020a638bc1000000b005bda050625fsi7604743pge.455.2023.11.09.13.33.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Nov 2023 13:33:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Uh6kWNv8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 5F041839F4BC; Thu, 9 Nov 2023 13:33:57 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230119AbjKIVd4 (ORCPT + 30 others); Thu, 9 Nov 2023 16:33:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230020AbjKIVdz (ORCPT ); Thu, 9 Nov 2023 16:33:55 -0500 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0929F3C39 for ; Thu, 9 Nov 2023 13:33:53 -0800 (PST) Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-1cc3216b2a1so11728275ad.2 for ; Thu, 09 Nov 2023 13:33:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699565632; x=1700170432; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=/unuH/wgOv+LMXS1Iv/n0xTf2dbEARyI1vRnvxRKBR4=; b=Uh6kWNv8F0dT/2DjpzMsfBHJQJq0CwmVL2CR2MCG19wC4fhM/YtuPFsWBGAVZqCS4k VuvNw2ymwOMqqfCUuoYLWHEkaiuu3/4mb+3e41wfvvBqRI1aJULzQ+NioFZye9E0Bdq7 fPoAiRqz+IjBDExo6O3gG6Sq5ukKosTIXc3XthFRIyFwJtV6uNN0vnDTZEkuJPmTznAP t2z2yglueCBVwgGRCC/jBDZCd/ZAKyDLGL9IHfOj/mTUvom9pFFn07s0Ynpnx1ftqfmA WWqo6oxmV5KI+sAt1wurpiDA4dQ/siQSAGg5SDaEOL6QOVgFEYPteV3MHhSBwq812UNZ AbCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699565632; x=1700170432; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=/unuH/wgOv+LMXS1Iv/n0xTf2dbEARyI1vRnvxRKBR4=; b=kgki2iq3hnICiOy/C5odyR1BdEM/vpn0ko03CwZ1kxI25aCQs1vKNax7GHTyl35W19 VDS/ktUk+XMD43Iosppmcbloz1raWxKE5umuo8ANgbpuann/tUMk6aWraf+804LJmhEH Woro2xgSx8wZZdGjIFyTj/Yw0Rirr2s8p2E7Yj4m8CBhRDxe7objLZUw8+TNTTUodXrH IG/Z7uIhzKYRih0ljQMrAMV+2eBavBc9T4o3nYZ7mviS2nI3h26WtfNBHObYPhDXrgXg n/r1MDMCTjtpgvT7eFMEXyjZqJ76V/P1txEmuC7o5IBhotp+Jz2LCD9MiyNBloHNTnv7 5GrA== X-Gm-Message-State: AOJu0YzvWUrlTypRpLUKVIb7pUQdxzCygHPLkCglTmgSr8IGDQWoCZgd icM50inU49oUg//PiUMfGSctkv9T1Ro= X-Received: by 2002:a17:902:8e89:b0:1cc:636f:f37c with SMTP id bg9-20020a1709028e8900b001cc636ff37cmr5781479plb.13.1699565632137; Thu, 09 Nov 2023 13:33:52 -0800 (PST) Received: from daehojeong-desktop.mtv.corp.google.com ([2620:0:1000:8411:f97c:cf47:191e:4442]) by smtp.gmail.com with ESMTPSA id c10-20020a170902d48a00b001cc46240491sm3977722plg.136.2023.11.09.13.33.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Nov 2023 13:33:51 -0800 (PST) From: Daeho Jeong To: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, kernel-team@android.com Cc: Daeho Jeong Subject: [PATCH] f2fs-tools: initialize user cache valid values Date: Thu, 9 Nov 2023 13:33:48 -0800 Message-ID: <20231109213348.675704-1-daeho43@gmail.com> X-Mailer: git-send-email 2.42.0.869.gea05f2083d-goog MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 09 Nov 2023 13:33:57 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782123739575449557 X-GMAIL-MSGID: 1782123739575449557 From: Daeho Jeong Need to initialize user cache valid values to prevent from providing false cache entries. Signed-off-by: Daeho Jeong --- 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;