Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp1243188rdh; Fri, 27 Oct 2023 08:31:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHE7yvl8KzwzYJ2fQqUeqjn1ogzpzAdU7qMGh4nYLS1g/NNGImbLBxQtfp2bjO9Wu4HGiyj X-Received: by 2002:a05:6808:34c:b0:3a9:ba39:6d70 with SMTP id j12-20020a056808034c00b003a9ba396d70mr3252269oie.23.1698420661939; Fri, 27 Oct 2023 08:31:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698420661; cv=none; d=google.com; s=arc-20160816; b=IWawhVmPUkaoaydA58p9Pmb4cuaSv33tclas3uTXR28mWEbA8efD63J8JQBk8YEOgb 6w5kT1buvZeL+1IjnT1/ocnSGZg+FUqBISuoYSj81Ww7W6q6NKQMcFH87EgPme9yRjiT hD/+AVuTeNnREr+bEfbAOhmt/ZSYZvU1iTZlv5O155q2a11wBvHTi66csaD81CRmMERI NnlQC5JN3Adgp/tu6Bh41RojuMCA2KSXwdpKCUJ+PW108yD4bmOjGVOwN1N6lmX7tyZZ OggeoVrvkhpf9LyK/4sXN/1fpW5kwBl5LUnCwVq5TFwrFSCkTJ7hlNpVOkMne205+TsO JM1Q== 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=Evqr8X6UfMuvTJbckZTyJVytbmNduRUqY597JEFkmzE=; fh=IvJDhn2XbJ55zxf0p/e9A+SWoPpre/ymwh9Q/MPTdCg=; b=sKpkBCvzO2Hn8dRvabR/ZFMQbHumcNbGK86UBoVW0FJXlfiAJY2XjsUQZyLeWsKquk Ph1Ab2La4cHWKr1XshtxkfXzbZceIHW3Oav8ZlTHr23mJtIBNc9kDixRt38xsRZTG6qd lMgr6A98rbjW/gsIl/YOU9SvZXJQGD6+8xz5YSQ8YdVZ9Mr6AAJBf7r2zpuLGCWNHm5l N9iwNK0mXNaSlKnR6Kx83HByUKC8noysRksqtw3+axtH40EMFiPNAU1y2BYZUY0ZWJd/ LejshtgAMBr9WJ7Su3L4QdIXdaxH3r8TqIkQBANkiP/4zUwspSk+X48tj1TB8OyIqTgA Frpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=fjNkqMH2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id n70-20020a252749000000b00da04d3c074fsi2806827ybn.648.2023.10.27.08.31.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 08:31:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=fjNkqMH2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (Postfix) with ESMTP id EDFFE83731B5; Fri, 27 Oct 2023 08:30:58 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346274AbjJ0Pav (ORCPT + 99 others); Fri, 27 Oct 2023 11:30:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231793AbjJ0Pat (ORCPT ); Fri, 27 Oct 2023 11:30:49 -0400 Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2B99AC for ; Fri, 27 Oct 2023 08:30:47 -0700 (PDT) Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-6b3c2607d9bso2122743b3a.1 for ; Fri, 27 Oct 2023 08:30:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698420647; x=1699025447; 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=Evqr8X6UfMuvTJbckZTyJVytbmNduRUqY597JEFkmzE=; b=fjNkqMH2jnQmJPfTWwCO4o+v5rgGOiJ0mMFZbs9hN1fr7ZJQF9M/5cF2WNRKkoIYeQ itCmpAJTvoTJv/VHjglDEgGPjMcS9yilzvozzCg1u5QxgZ+/hvHshoxHNQU7oNkP/xro A7l7GZp1YqJTzXrn1ZIqtg3Tf2fIITtB3qEQ/Byups/ul+6HPRy/WIFgLzvgmPwl/kdO eM7//lO24A6RlpVN7Q/1vwe11ahaYVkfzR8ehWdQf5OUuc5GTN5dPE1jbr6tMEjBQOvf 2B8/W4d/37pWqe5aaV4gzO3O2/qPbK/EBE+Xe8nSS6p6/GMUS5l7iPqtvDdztMJKUX72 WEMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698420647; x=1699025447; 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=Evqr8X6UfMuvTJbckZTyJVytbmNduRUqY597JEFkmzE=; b=BvB1g3XQB3NT+esclHhC0rWmUqSRBJV9YjhCfUa8SPV7V8MaX3L/PTMPxj5AOhqYmy 8eEMx+CfihSEv5cM/zdLHJAj5nTGbNjyGDREAP7IANMvi3xQL+pDsPrHDN3J+5UyA2sB bMOSGF0F1L214xc3ftvqOe7Eco01qm3+kCrJ/5i9uVLKoJbUT2qnwOwMsmzrmlc8NPBH zRaCOiL4EQ+Dqw5K4We9Tka3IwWvLrie6k8Fe+OtI3IW4x9LNawPn/mo/yX+f4nukKNl 6kvNViKed1rZNJ+HexzVtNJgEBuUMGilAWIfK0xD3BM6wHvSwRjzZZnyEwNz6yMgFp6D Py2g== X-Gm-Message-State: AOJu0Yw97MNIZLlsvOYXqgHHkwdKUsTe+CCSv8Lo6B3VAGSY/POJr+zF y6sVpbX+zzPsrdRkq/EOjyhRCTmao7A= X-Received: by 2002:a05:6a00:1302:b0:690:422f:4f17 with SMTP id j2-20020a056a00130200b00690422f4f17mr3285641pfu.4.1698420646936; Fri, 27 Oct 2023 08:30:46 -0700 (PDT) Received: from daehojeong-desktop.mtv.corp.google.com ([2620:15c:211:201:d9fe:c408:7e52:ad85]) by smtp.gmail.com with ESMTPSA id d3-20020a056a00244300b006bde8e1f0adsm1551946pfj.98.2023.10.27.08.30.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 08:30:46 -0700 (PDT) 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: use total_node_count when creating a new node block in fsck Date: Fri, 27 Oct 2023 08:30:43 -0700 Message-ID: <20231027153043.1381438-1-daeho43@gmail.com> X-Mailer: git-send-email 2.42.0.820.g83a721a137-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email 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 (howler.vger.email [0.0.0.0]); Fri, 27 Oct 2023 08:30:59 -0700 (PDT) From: Daeho Jeong We might allocate more node blocks than total_valid_node_count, when we recreate quota files. Signed-off-by: Daeho Jeong --- fsck/segment.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fsck/segment.c b/fsck/segment.c index 4b05fd4..4ea0a6f 100644 --- a/fsck/segment.c +++ b/fsck/segment.c @@ -36,8 +36,8 @@ int reserve_new_block(struct f2fs_sb_info *sbi, block_t *to, ERR_MSG("Not enough space\n"); return -ENOSPC; } - if (is_node && fsck->chk.valid_node_cnt > - sbi->total_valid_node_count) { + if (is_node && fsck->chk.valid_node_cnt >= + sbi->total_node_count) { ERR_MSG("Not enough space for node block\n"); return -ENOSPC; } -- 2.42.0.820.g83a721a137-goog