From patchwork Tue Jun 6 17:39: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: 13269512 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 04703C77B7A for ; Tue, 6 Jun 2023 17:40:02 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1q6af1-00029y-J2; Tue, 06 Jun 2023 17:40:00 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1q6aez-00029r-MS for linux-f2fs-devel@lists.sourceforge.net; Tue, 06 Jun 2023 17:39:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:Message-ID: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=FC01jxOBSLY7ZKXPg/UOaGu8vDRxRyeIgOBpQX22Jyc=; b=WdHFlQFNIyAIoE1pI0+aOp5D8b NT49sq32WG+/wPEUOxB72FNMJt3feK1FeSGShFRxuQ4rHb3rM1W91nBCKtu+8h30vjVwIn0Qo82Vb 2ajDbidxiMwVeJ6u3eLFec/0nYaAei5ekG9hcg2hanXFEPFJ3oU3DMmIM34b7q1VLWmo=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject:Cc:To:From :Sender:Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=FC01jxOBSLY7ZKXPg/UOaGu8vDRxRyeIgOBpQX22Jyc=; b=m PMcU0+HGx4YvlmOOhiuuthTfU0nZ4zqqwyCEhE4Unn8cXC94tSVPsBBcnJHq0bgp0yPgXlUT26sS+ vno6qz75b/pqbg9p9KiuON8PF0WbKvbCIx4FzPrBBDpTOm92kHLfvw3bCRAlSZCTW2MNc85714z7E bQppMyzttfn0kFjg=; Received: from mail-pg1-f181.google.com ([209.85.215.181]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.95) id 1q6af0-00CwmC-03 for linux-f2fs-devel@lists.sourceforge.net; Tue, 06 Jun 2023 17:39:58 +0000 Received: by mail-pg1-f181.google.com with SMTP id 41be03b00d2f7-543d32eed7cso844641a12.2 for ; Tue, 06 Jun 2023 10:39:57 -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=dhB+MCrlwFdKwPkj3Qnu/ZsedM95H/VMyACj9Ao3q0xY8HISM6LylEtMw8HqYPfqVh HE0IRQNsq9nn8K4FjN7R3VdxLFYmf9lnTTBKZ05JV3k6ywxClAjaTnTI8Og5kyYznTK7 9aIM0U9RSaG+SpSc1MQrTt0mb7M9Iek8QN+30xF+CnmcVvmQHxYfgSvI/mO+g4mAgkdE OE6krUQ95Tzgg45khMOyKQPIZrzklGz+/9stW/o0cD6Bx0PsdXEWN4afUbaeRjXS0i0z 1NWFIWkN7CeYSfRDv3h48PdYLXu2s6IbFZQlL30EczweJo1uS4vGcXoUFYE7ER6cogPt 9a1A== X-Gm-Message-State: AC+VfDxk2GsymH9dcLbLoYrjx7nedph4PX9alsdAPcLaHPbh1uM8Drrg hqdGhUFP4XmVkmkKh1duosQ= X-Google-Smtp-Source: ACHHUZ67KIg/Mm9NMPhjTlayFjlenoLJPI4NEBi4xLY/i14s1DBOxzAioMCWtn7d/RPKGoOH81NjfQ== 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 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 X-Headers-End: 1q6af0-00CwmC-03 Subject: [f2fs-dev] [PATCH] f2fs-tools: fix wrong write pointer check for non-zoned areas X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daeho Jeong Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net 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 Reviewed-by: Chao Yu --- 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)