From patchwork Fri Feb 16 22:32:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaegeuk Kim X-Patchwork-Id: 202384 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp27077dyc; Fri, 16 Feb 2024 14:32:29 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXSblPgkJjvKnjKlBmgZoKnNk1BUkDNJ7FXQyVOi84v4SGMXfL1kCprUF8TT2dQ1f9BpAfe9QPawN4Xy2+Z2uxQq9wAiQ== X-Google-Smtp-Source: AGHT+IG4pEzfYrlfDbKvQFD7X9BM+90vr9OkmSniErWWv56lKhIWYZAahEFSIjtxoeK0cdqtL0dz X-Received: by 2002:a05:6a20:6f07:b0:19c:7798:5c84 with SMTP id gt7-20020a056a206f0700b0019c77985c84mr7367949pzb.56.1708122749083; Fri, 16 Feb 2024 14:32:29 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708122749; cv=pass; d=google.com; s=arc-20160816; b=Zs9fdIjOTtJ8twI084nhRR7LyfEuGQuWTfQnxXLdCo+HLbtEa1xMnRBkTwsDcdUcHH 8B7KJ68FySLXU/0Yyw2efqL9xF4CI+0bm4saRZwnbRvsj4ZHSCtPKnFgqIuoiLGXSsK+ /w832uBzkAb7U/Wst7ThdOqFrXgk87Z/VI2K9idEfO1jmDsEYIlhagsPrk4GCrRk3Zy2 3RYvTbqV48p9fMJ7nvaB6OXz0SnXqEoqk88v7lU8ykT0sREfFrSFxrcX8kjJLAdjURTd mwOGYeUt2rvHhcPXGl4ClcQOKtOxMQhkKk93xtoDQenIbD2d5yRSwb5jzb4UAwFcHjt7 cFmw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=eogWWGunrScH2e0BmYG++mqTWh/RhliOG8kce8lceb0=; fh=rqHW7NazYv3wAmgqDKAbZUXWTmf0VaM5epB9R4zfTUE=; b=h8VbsMY7ReaHk2jbRsL4QIuJn7IW3s/l9Yo+imAs7esj5tLfmlyqpAOub6nHzYkiAn fNUW61TB2QHBTp3CewqzrbKvQVILT7z5XbUzBARyl2eO6eOqwyoUU2+6BpfMk6dOEnGq b/sPuJRluoEOdS7xcqhScmrNxsGfR0svD89C7sJjvf4nVVdzN7OcOTqyVfGy4p65UaiW ihS9ArQHhna3U85X+Vyl+7u+Ri7NF3vb/QHMj4xAfyqKV2M1f1PhNeREag5CWIwR2126 UtKuVNI3YuCCU4L0+zD5zFPX2z78roUrBR6QkoKL3IG4+RCL1okHkCs/6frsXAFOC0DB Pi4Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PC+NeT1+; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-69404-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69404-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id n21-20020a056a000d5500b006de169e5800si543082pfv.373.2024.02.16.14.32.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 14:32:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-69404-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PC+NeT1+; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-69404-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69404-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id E1A3E28C6F6 for ; Fri, 16 Feb 2024 22:32:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7942014831E; Fri, 16 Feb 2024 22:32:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="PC+NeT1+" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E7C6B1DFFD for ; Fri, 16 Feb 2024 22:32:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708122731; cv=none; b=Kv/2firmXwXz28XnTxHUzFHxigNWyfgM1mRIGBIcgpKs/E05/cAjD8bNxeSB9HrukJ6VHa1XACITulFFyMJQD62hfG2kbhOreO+GkMyNcRS+wWhlbal03tM9ugaLyjKse/wLqsyjf31GzfQvEcUgyKAzOutZ9NdnQjRzGV+F278= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708122731; c=relaxed/simple; bh=c6HKSK2nlZ4KsJ8exupjfyksGkk+o2n/wAUv5WGdAgM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=KlPY64zQUFrFRlSZuFMrL2XdzTEAGFdjFkcvnGBVEiRZ5tLsY6OdxYNQP6QsDwewQKF6t8wQGCMBJsSRUsW3HIiWIeh5HI6q7/G+PbscVN+2hMl47jpyyj5OFZ6Ip5UU0YC9wQzicRg0p/w0llxf7fm18/0SkYPoQJdW36bTr1I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=PC+NeT1+; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6C419C433F1; Fri, 16 Feb 2024 22:32:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708122730; bh=c6HKSK2nlZ4KsJ8exupjfyksGkk+o2n/wAUv5WGdAgM=; h=From:To:Cc:Subject:Date:From; b=PC+NeT1+C/iDjvmSSQ8T/upGHRveFsAL4W0Ln+vG+fY4WJOP/cyHmpENFfnkFFTxq fAqpHVEfOZaywCIDmTxU+q8FXksga+fPeW9U8Xby6hiWhIDR5RAmVt1PYFa3HWm6Pv DtsKv69LdufuklA6u+jHz5A7vhoA3lAURB8Ok8tQYYjf45iBOGckyW8YbDDu/hU5I7 nVy3uofx5NQsip3qd782f82+5LTvzPRjEJF6ih21lo4LrOryuEVdeyqbfVAY6MreYC pqShMEdzI9xtW7ZorrVGpAd7/z7lzMzhaUAX8KWYu2fDy5vjLNUysQFelgHdHJU3HN F2VKUS5kDQlFw== From: Jaegeuk Kim To: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Cc: Jaegeuk Kim Subject: [PATCH 1/2] f2fs: fix write pointers all the time Date: Fri, 16 Feb 2024 14:32:07 -0800 Message-ID: <20240216223208.443024-1-jaegeuk@kernel.org> X-Mailer: git-send-email 2.44.0.rc0.258.g7320e95886-goog Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791092281860744894 X-GMAIL-MSGID: 1791096519613480641 Even if the roll forward recovery stopped due to any error, we have to fix the write pointers in order to mount the disk from the previous checkpoint. Signed-off-by: Jaegeuk Kim --- fs/f2fs/recovery.c | 2 +- fs/f2fs/super.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/recovery.c b/fs/f2fs/recovery.c index b3baec666afe..8bbecb5f9323 100644 --- a/fs/f2fs/recovery.c +++ b/fs/f2fs/recovery.c @@ -913,7 +913,7 @@ int f2fs_recover_fsync_data(struct f2fs_sb_info *sbi, bool check_only) * and the f2fs is not read only, check and fix zoned block devices' * write pointer consistency. */ - if (!err && fix_curseg_write_pointer && !f2fs_readonly(sbi->sb) && + if (fix_curseg_write_pointer && !f2fs_readonly(sbi->sb) && f2fs_sb_has_blkzoned(sbi)) { err = f2fs_fix_curseg_write_pointer(sbi); if (!err) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 0b3b18715bec..a2b7a5c448b5 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -4656,7 +4656,7 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent) * If the f2fs is not readonly and fsync data recovery succeeds, * check zoned block devices' write pointer consistency. */ - if (!err && !f2fs_readonly(sb) && f2fs_sb_has_blkzoned(sbi)) { + if (!f2fs_readonly(sb) && f2fs_sb_has_blkzoned(sbi)) { err = f2fs_check_write_pointer(sbi); if (err) goto free_meta; From patchwork Fri Feb 16 22:32:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaegeuk Kim X-Patchwork-Id: 202385 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp27107dyc; Fri, 16 Feb 2024 14:32:33 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX+tZG5iZK+kIqHMKbpw6kWKILRy3RyKKPzetLWb6US+ibff7b8xR2dqrNnfxxoAjzfZRpNnwlbVc0aSymljml+KCG0jA== X-Google-Smtp-Source: AGHT+IHxhuqpvPWUgHTkx+rnGVkVNp42HV+6vknpnydECLu0uG+1/7s4N7Nhzvk+8C7DyF/RFcQJ X-Received: by 2002:a17:902:d4c8:b0:1d9:dfa1:e4ee with SMTP id o8-20020a170902d4c800b001d9dfa1e4eemr8204406plg.25.1708122753626; Fri, 16 Feb 2024 14:32:33 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708122753; cv=pass; d=google.com; s=arc-20160816; b=U5g75FXS+ebkW7wN611VByyGEkG93o2a/VcNa1RkgTEaHfr5GjKb437W1PK8PiQK0a kaT26mOGPw5Kv1M9xxANp0lVCKNATy7ussWko/7ldomVtJUyPKf5ZhfeHxL8vbXIAbOB hLiUaDYelf+V+DDc/RNVZaxk09CuJU5o/Azjvpp+jV8+Db5hfP1Kksoq+m35MwhheHOM HLFpKHEeS3xvB5ZQhHC+tuCoqwBnR2bahhGM9w3IvdgEStwgGloEaDtU6N/mmlRfKfHd /N3GY86Nz6SYat8UcL/45xHvCsetvgpnjkTHdCqx89R5GuQ5eOV8c0D8mk6+XwwtvNxm dc0g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=4xPjPyyohDCitC/Sqf3LzbeIlAmGng9ri3/WSzUa+/8=; fh=rqHW7NazYv3wAmgqDKAbZUXWTmf0VaM5epB9R4zfTUE=; b=f5xuU+pvuzAF11JdF8pn9Py57waJLt0NtupoKp4rSAtFfr5IBAbwv06iOB9opg7GV6 j0NcK7ljjOCg8tO/JCYxDwCaJ/KOybgHDi/5aaBHUHLCLcIP8Qk03ZeukCtotszq6nkO 7j/gkW+3rLN2KYMbGYNYYJCIBaxDKmor+G/f4lWwe3e5ygPPNuLxRvOzlURrDZ1IWQSF ixwGIr7qaqBjZXeOTrJ8SOYCxiT55rBy/ydmrQs+cLMB8iDKzu3IOF548U1X6mfwqV26 X9gBE7i/YtmkAIr4DVaYNTs347yJljUrvOCSPrznPmYTZhL3TqlqAKete3iTcxitdpx6 YQ0w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LT7HqGzw; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-69405-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69405-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id i18-20020a170902cf1200b001d8f3a10d9csi481995plg.595.2024.02.16.14.32.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 14:32:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-69405-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LT7HqGzw; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-69405-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69405-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 71A3428C6EA for ; Fri, 16 Feb 2024 22:32:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1251E1487CB; Fri, 16 Feb 2024 22:32:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="LT7HqGzw" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7D69012BF0D for ; Fri, 16 Feb 2024 22:32:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708122731; cv=none; b=k07qA9SD2JR1jmIyU2rtdPd9ai+WVz98krBxhppxxTNAyjOzzgzL2YaLcQ62PKnFYqp3yuLbRluqgKmeEVwuE/k4ynAjjSQzrJV9HnJFhRBV/tEi2K4zJ+FtRXa/YS+As473t0BZxtP3XgDHVkzMS7FickS+lryEBge3oi6ryTA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708122731; c=relaxed/simple; bh=BNjwzfz+8rUOwJ8I6tUQYA45nCwEW2fVJcmb1pvmVYk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=heD1glJuWmd2AHrXjdr6I8ZbfHl39m6WBzM3Ie0HMgNOEy3T34cIjzQHyPiHXnZo92vyb1hpZPzk+CXor/SopGgXFMYedDVnlF7XWCOSLLGctVUQDTe/LSQ441SkGqmgeHqLVy4Qu/6rSIFLbCeCThFeqGA+g8pa90KQubas0j4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=LT7HqGzw; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3F928C433F1; Fri, 16 Feb 2024 22:32:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708122731; bh=BNjwzfz+8rUOwJ8I6tUQYA45nCwEW2fVJcmb1pvmVYk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LT7HqGzw8AW3DgO12/pwHOdv/1xgeeTvVSJyVm/jEoyEfkahOj0Y9yvKRVrdxsgYu P7pGkT0+vFqnAg6/LCybblKkUMvKP+m0kJD51Z58xs2BwzSByUwAww+WZvn0qgmrmo xjZlPBfFNTEIVQhU6H1Qil8jt99zACJlqE9vMqC86BrTrREejXK2drgcfp4Un8DmpN qvFb8jbO29TnfaU4lqnSrUkmB09sbknwOcBXEFxE9fzlYZ3o46b0C6W/7Cp/8JE4ag SLVEOxQUrn+fQrvKdt2bx01wiumnaL8aMeHuQul6L6gdPhNw7REIOw9BXnJq8cFzym 2mBe/PzOYJ9AQ== From: Jaegeuk Kim To: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Cc: Jaegeuk Kim Subject: [PATCH 2/2] f2fs: print zone status in string and some log Date: Fri, 16 Feb 2024 14:32:08 -0800 Message-ID: <20240216223208.443024-2-jaegeuk@kernel.org> X-Mailer: git-send-email 2.44.0.rc0.258.g7320e95886-goog In-Reply-To: <20240216223208.443024-1-jaegeuk@kernel.org> References: <20240216223208.443024-1-jaegeuk@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791096524835616378 X-GMAIL-MSGID: 1791096524835616378 No functional change, but add some more logs. Signed-off-by: Jaegeuk Kim --- fs/f2fs/segment.c | 34 ++++++++++++++++++++++++---------- fs/f2fs/super.c | 1 + 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 4e248be030a6..3bbb80487b13 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -4855,6 +4855,16 @@ static int sanity_check_curseg(struct f2fs_sb_info *sbi) } #ifdef CONFIG_BLK_DEV_ZONED +const char *f2fs_zone_status[BLK_ZONE_COND_OFFLINE + 1] = { + [BLK_ZONE_COND_NOT_WP] = "NOT_WP", + [BLK_ZONE_COND_EMPTY] = "EMPTY", + [BLK_ZONE_COND_IMP_OPEN] = "IMPLICITE_OPEN", + [BLK_ZONE_COND_EXP_OPEN] = "EXPLICITE_OPEN", + [BLK_ZONE_COND_CLOSED] = "CLOSED", + [BLK_ZONE_COND_READONLY] = "READONLY", + [BLK_ZONE_COND_FULL] = "FULL", + [BLK_ZONE_COND_OFFLINE] = "OFFLINE", +}; static int check_zone_write_pointer(struct f2fs_sb_info *sbi, struct f2fs_dev_info *fdev, @@ -4871,18 +4881,22 @@ static int check_zone_write_pointer(struct f2fs_sb_info *sbi, zone_block = fdev->start_blk + (zone->start >> log_sectors_per_block); zone_segno = GET_SEGNO(sbi, zone_block); + /* + * Get # of valid block of the zone. + */ + valid_block_cnt = get_valid_blocks(sbi, zone_segno, true); + /* * Skip check of zones cursegs point to, since * fix_curseg_write_pointer() checks them. */ if (zone_segno >= MAIN_SEGS(sbi) || - IS_CURSEC(sbi, GET_SEC_FROM_SEG(sbi, zone_segno))) + IS_CURSEC(sbi, GET_SEC_FROM_SEG(sbi, zone_segno))) { + f2fs_notice(sbi, "Open zones: valid block[0x%x,0x%x] cond[%s]", + zone_segno, valid_block_cnt, + f2fs_zone_status[zone->cond]); return 0; - - /* - * Get # of valid block of the zone. - */ - valid_block_cnt = get_valid_blocks(sbi, zone_segno, true); + } if ((!valid_block_cnt && zone->cond == BLK_ZONE_COND_EMPTY) || (valid_block_cnt && zone->cond == BLK_ZONE_COND_FULL)) @@ -4890,8 +4904,8 @@ static int check_zone_write_pointer(struct f2fs_sb_info *sbi, if (!valid_block_cnt) { f2fs_notice(sbi, "Zone without valid block has non-zero write " - "pointer. Reset the write pointer: cond[0x%x]", - zone->cond); + "pointer. Reset the write pointer: cond[%s]", + f2fs_zone_status[zone->cond]); ret = __f2fs_issue_discard_zone(sbi, fdev->bdev, zone_block, zone->len >> log_sectors_per_block); if (ret) @@ -4908,8 +4922,8 @@ static int check_zone_write_pointer(struct f2fs_sb_info *sbi, * selected for write operation until it get discarded. */ f2fs_notice(sbi, "Valid blocks are not aligned with write " - "pointer: valid block[0x%x,0x%x] cond[0x%x]", - zone_segno, valid_block_cnt, zone->cond); + "pointer: valid block[0x%x,0x%x] cond[%s]", + zone_segno, valid_block_cnt, f2fs_zone_status[zone->cond]); ret = blkdev_zone_mgmt(fdev->bdev, REQ_OP_ZONE_FINISH, zone->start, zone->len, GFP_NOFS); diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index a2b7a5c448b5..cb597b8e8ec5 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -4657,6 +4657,7 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent) * check zoned block devices' write pointer consistency. */ if (!f2fs_readonly(sb) && f2fs_sb_has_blkzoned(sbi)) { + f2fs_notice(sbi, "Checking entire write pointers"); err = f2fs_check_write_pointer(sbi); if (err) goto free_meta;