Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp7471599rwd; Tue, 6 Jun 2023 11:09:21 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7wyAlq90eh8vQEmlPvEGNUtVENTdJaK8WYRTJofOEQC6HbEo/8senqIbH/27XiG8eelCIi X-Received: by 2002:a05:6a20:5496:b0:10c:1b38:c89d with SMTP id i22-20020a056a20549600b0010c1b38c89dmr495647pzk.2.1686074961617; Tue, 06 Jun 2023 11:09:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686074961; cv=none; d=google.com; s=arc-20160816; b=ydebC2gQWiCuIU635zxBwLfy+g0tOoUjV/oJ7NCXtC87ueboSt6t9TjwERQj31Axtu m86UoGfouxKFq6FcGI6TfI38IHO7HUN8pIdQTsL864WOhZxm0fC7sP6lmPNL1fwxeJsK J3LlEDLy5T+E42UAoegjqZb8sIpyvMdP2OlKscheiNNk8RIlRF59pdXY+Nn9pcVeL472 I4u3FQ47Wir/r4AxRK8ClrSnBiCbp6dBc1t7e6Zuf5pUlQ49W0fRepfiBE4YQ5ANRwHD MVQDbj0AgQVbYVk7sQxqabJil4mC5NVDa25L61tTG/9ML4TIKvq5mBMxGoqd3xAs4Jg9 aEkg== 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=FC01jxOBSLY7ZKXPg/UOaGu8vDRxRyeIgOBpQX22Jyc=; b=S75MFjB4mIhzASqBc+vOHHB9wuZHbeYq6GudURNhJ1OclLPZbLUS2ln1QRIJYr4Hbo woBPuwJK6t5qbZ1ySO3D2Cfl3+KKseyCXRj8i5pjGe4vSCY0+PQDah37wxeAvs3jd1Cf pdNfp0msr36WRZ+NMlECbz6t/JRUDY04nZ1uzf6PRWxReikwNMHB2hBdy2KA3SH5pfvz A4A7Y/IuUE0l23mXOiw44QfVxiwGkV6qxWfGyhYOGLxbN9lSTX2DEUpWPaS71GQc2twK 9GHlWp/RxC/MBKYvALZDOkGmU4PAU6P5OZA3QrKgY2Hd7JpYzEoCoeWCmi7eXkWZ3uF+ y1Pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=CAbk5mQi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id iy9-20020a170903130900b001a19bd8aa63si7472260plb.36.2023.06.06.11.09.08; Tue, 06 Jun 2023 11:09:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=CAbk5mQi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238346AbjFFRkU (ORCPT + 99 others); Tue, 6 Jun 2023 13:40:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238712AbjFFRjz (ORCPT ); Tue, 6 Jun 2023 13:39:55 -0400 Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 471F210F8 for ; Tue, 6 Jun 2023 10:39:53 -0700 (PDT) Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-6537d2a8c20so3015572b3a.2 for ; Tue, 06 Jun 2023 10:39:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686073192; x=1688665192; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=FC01jxOBSLY7ZKXPg/UOaGu8vDRxRyeIgOBpQX22Jyc=; b=CAbk5mQi2P1KsDiLqmuh5rlEyijisBivA760hzTefSWQWlpw7TJLIzVvN5RklboRtr 14WgBjG8JrA44rskY7oEjPRK+eM720JDUaRgRt/RHP1BfaikiT8inDBh8px4ddQV7PHV 1FTrHIHe8fZ6jEvpRMymIi0PuyUvITmn4VgPfRYcYhqcn8H9/cDqPBOqAUuC7nZmtDXv 7IV48/6OP5xb9YYNkDdmfpTuHeEnAIPtcHxLWkSHAoDuAweACUKWYIfA8MdYTysegZR9 DiIzTKvdjwbzK9qpMp1ZUm1MwVspB91+FcsCnX3iYNDvOy17uBwn9Xu4H2NS+KVWsbqg oTgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686073192; x=1688665192; 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=FC01jxOBSLY7ZKXPg/UOaGu8vDRxRyeIgOBpQX22Jyc=; b=l30zxAZuPogR7hULSlRMZHS/p55j24cJTITMV7g6lGfd1RVP2ic/LmrgbznuhiaKhW 4wCvmKinP6GJYWSmo0S35qEhhMVgnTAVRSobdTALvs3B3FrJYpuxnJftvj7QR/Br3l1R 24FRUKmVn+UVkH9NrALmcy975Wrjq119SH00LL78vdYFGQ/OAav+43ZlxzLyqRaQk6jZ qg0Kbv3O8eYcir5Bj+XcUUpIoDtwuDS7HCEtrFbDXWJgeOgg7W2IB8lAnaTH5mg0qVfe F1YJRNJTJG+1WF0Ib9aayfPVBFskT60gkjJaAEpbpddaibJL9C2OOqfZYnE10R1H/hDU zwqA== X-Gm-Message-State: AC+VfDzBYAIczCyiO7hDWM/hvclu/QM3pzKUNnRi5pRRfZaxlQ1UTrkq nM9gjL/PapmSnoNadC+RjPucp8T0IH0= X-Received: by 2002:a05:6a20:3d93:b0:10c:34af:a469 with SMTP id s19-20020a056a203d9300b0010c34afa469mr425310pzi.16.1686073192178; Tue, 06 Jun 2023 10:39:52 -0700 (PDT) Received: from daehojeong-desktop.mtv.corp.google.com ([2620:15c:211:201:72aa:6329:65da:3ad3]) by smtp.gmail.com with ESMTPSA id l6-20020a170902d34600b001ae7fad1598sm8818368plk.29.2023.06.06.10.39.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jun 2023 10:39:51 -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: fix wrong write pointer check for non-zoned areas Date: Tue, 6 Jun 2023 10:39:48 -0700 Message-ID: <20230606173948.3390215-1-daeho43@gmail.com> X-Mailer: git-send-email 2.41.0.rc0.172.g3f132b7071-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Daeho Jeong Do not check F2FS_ZONED_HM for the whole device. We need to do this for each area of devices. Signed-off-by: Daeho Jeong --- fsck/mount.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fsck/mount.c b/fsck/mount.c index 851a62b..0ebbfcf 100644 --- a/fsck/mount.c +++ b/fsck/mount.c @@ -2868,9 +2868,6 @@ static bool write_pointer_at_zone_start(struct f2fs_sb_info *sbi, int log_sectors_per_block = sbi->log_blocksize - SECTOR_SHIFT; int ret, j; - if (c.zoned_model != F2FS_ZONED_HM) - return true; - for (j = 0; j < MAX_DEVICES; j++) { if (!c.devices[j].path) break; @@ -2882,6 +2879,9 @@ static bool write_pointer_at_zone_start(struct f2fs_sb_info *sbi, if (j >= MAX_DEVICES) return false; + if (c.devices[j].zoned_model != F2FS_ZONED_HM) + return true; + sector = (block - c.devices[j].start_blkaddr) << log_sectors_per_block; ret = f2fs_report_zone(j, sector, &blkz); if (ret) -- 2.41.0.rc0.172.g3f132b7071-goog