Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp91746rbb; Fri, 23 Feb 2024 12:55:53 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUi7QTFNxRd+Guqa8EGGZBpnRqa9Tv0nRcrtL7ENrhySmpTROpdmkvLSvpjQrYr478QWIPINfJZq/cMszzDqQ5QlNkOJZBFjmIOBqhB1w== X-Google-Smtp-Source: AGHT+IH5MrpIAokywJVy+UnE65hI2cOcM3qP8e4MZL2uDAciV24EGhme8WamQTbxCaUcm3K71vtQ X-Received: by 2002:a9d:6c4f:0:b0:6e4:7a59:ac62 with SMTP id g15-20020a9d6c4f000000b006e47a59ac62mr910062otq.24.1708721753344; Fri, 23 Feb 2024 12:55:53 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708721753; cv=pass; d=google.com; s=arc-20160816; b=0oaYTUs0JoIucpsj5YapzZCcX4B0uJSWpRgE5OEcJt3xC5wwTo86o36l9IjLfQEzgN kEXKQYUE+xcsSPsMSdJtWGjlJrtCBSxaVoUXEk56dwf9xVkG9t+Ayf8cGmUyBOPMOUKO FCkQv+hr1DCtXEEF9xpR5zGVe7OG7KVD/lBM6YqMczXpcCTiJRtngcUf6tERBa+RWNyP w4bEvFVTIRgp4/zckOYWzsqr5VNlU4wj3viSinsCPsuDbgfy7z3GA00mVVDBWkjaeEjO BMWsGapWcvfD8BDaUkj1RWZ2lWoAvv0JYHxC775RkZmmlEbFBgwZyyXgvjj0LR5fPEVC g26g== 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=d6MvAWa8krcr3w/taXqtwCdQET9wq8pEdAb3QBFq3EE=; fh=rqHW7NazYv3wAmgqDKAbZUXWTmf0VaM5epB9R4zfTUE=; b=0xXwho2DdEtIRffhXgwyknUdvlc6YMpeYZpszcwtBYkFsAaG4dXQKVqF1pXEvWvcWH Ogv5Mfd1ZhsmL5NtpQuLhGvEoJca18b/KAewOhJxgSO347Qj6wBZdNM0dlwBrxrnmB5T JhQHxdu3R3OHquwEm76U9D+if8ImrbamnsNPy34qtYt5gCJ/fVxTt7cP/Y+cTTjCk3d2 nXJwWcItjwgwzEO6MNpDVoknmhpFrJeEwJvkSZV6Reia2OanvlyJC89jQkosSu5bRW1D EsUfQFK44yBNjRqKr+rLfOJdOpelnM9JLAlmlrc5DHoOdmPfT1pluZk2dBAM5nzFF8TZ ZOlg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JDztIDUM; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-79147-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79147-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id i22-20020ac87656000000b0042e5fee575bsi2124567qtr.195.2024.02.23.12.55.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 12:55:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-79147-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JDztIDUM; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-79147-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79147-linux.lists.archive=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 151C11C2384A for ; Fri, 23 Feb 2024 20:55:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3E3D1149388; Fri, 23 Feb 2024 20:55:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="JDztIDUM" 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 674571482E7 for ; Fri, 23 Feb 2024 20:55:37 +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=1708721738; cv=none; b=N+CSZpL2HlT26SKJOchMPO5O+7gHNSoOm/JAPbgPbMn8qSN+kbyhpXEP2SMzKARy0o05g/kGuDqdqPr/k5ZrSuIoa8uVztY14TIEUEM+UiPTwzkJEo7gxzj8PHI/L+Xdgh96mSDWZ+zXoEcP9LJb/XHE++WxU0NwDrpGsAeYlkU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708721738; c=relaxed/simple; bh=1gKonBQkHb/HxNH0cWOVYXamRfmS4ibjq2hXF1LjSXM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jUMrPDfxa/hQt/0+UU/1Z0HdIQPcuW7ljbo7hT0gX0uvBrUZLZDeBdV9xB82Z2CYHvJ14dee8pGRxu4XmlCNuMG7s6ALDoptOccFh/O5afUcWoV9wxnqIB82hUAbaksD30CdCp3IO4aKugexILKDF2nmDc0TtthciFs71LBDY6A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=JDztIDUM; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id C8180C433C7; Fri, 23 Feb 2024 20:55:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708721737; bh=1gKonBQkHb/HxNH0cWOVYXamRfmS4ibjq2hXF1LjSXM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JDztIDUMIf1uQI3wEPns47jCdJLcgDmWlGKrDDrzZPfvjYREA206ffnpHXWjr8NoN 1E1L3M677M9HaICSVu7GqwVPSS0gBAJkgule8HcadYMs8pialTn+Oo59lqQIw+vNwt jlouFmp59ZghxaJN2TnlEmF9erPZoJdfJL1XuhrJta4b4DScZ/tzkwLJpZkDE6I535 CD13j4vOBtp9MiZRkcEfbc55lmB4jw/WP7M+TGrHxTipMhogw6jCdTPeHtSXsj5Px7 EFFF6vjgT6aRfcTQ6HtUXZSNtISV958zN2YFFGwIb9ps1emAkvT8ilyeI18ouCpGSW RDSSuPrZGO9AQ== From: Jaegeuk Kim To: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Cc: Jaegeuk Kim Subject: [PATCH 2/5] f2fs: fix write pointers all the time Date: Fri, 23 Feb 2024 12:55:32 -0800 Message-ID: <20240223205535.307307-2-jaegeuk@kernel.org> X-Mailer: git-send-email 2.44.0.rc0.258.g7320e95886-goog In-Reply-To: <20240223205535.307307-1-jaegeuk@kernel.org> References: <20240223205535.307307-1-jaegeuk@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 2e41142d07c0..4d03ce1109ad 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -4673,7 +4673,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; -- 2.44.0.rc0.258.g7320e95886-goog