From patchwork Fri Feb 16 21:24:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaegeuk Kim X-Patchwork-Id: 202371 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp157dyc; Fri, 16 Feb 2024 13:25:07 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU0j/PyX9sq+tGNxjEvP2YTTH42rExnwHGkMjgj+O3sbLjBwGPN8pgxJevOKMnoV4UesuXfquhX6LDWm13iHl3YvLZ9lw== X-Google-Smtp-Source: AGHT+IGS7G0u5gFfF3RPe2fyFYf+UMwqN9zOCYmG6wWGtoY0e8s6jWw6i/naKUkA6rfpf3Yjj8aE X-Received: by 2002:a17:903:120c:b0:1d9:c367:2032 with SMTP id l12-20020a170903120c00b001d9c3672032mr7716750plh.10.1708118707715; Fri, 16 Feb 2024 13:25:07 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708118707; cv=pass; d=google.com; s=arc-20160816; b=wDnTwy2PD9nFNKSHLIUnfrAZHegXECBZ7wnhXhCt+FVk8jRkqCxZj3Qs1XLwldz4p1 o2lYoxk5SoMgfo74sJ1sIAQI4UI8Ijz4tjzhpGTKTu/M8QmoMEvQ9p+mVuP8wFaEu1z0 QuG5rwtp/gmuMJ0qgJWy2YphVA98OsJKyBlz16v4XLzGfc+p06dBLo+iHj1ZunUyGXXA Q5TACYTthSoqZGl/nYir8Br158FFOVreKp/gVy46oYE8QY+ftk81IgwEgaEg+NtIugeb a6RrJpAUE4ZOV6R/yYWybdyXqoKyTFxVq1z9iEjDbRTkbu/DVGp4iSSgtgoi83thYmtF 3eVg== 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=hryzUS0A4oTQ6IR7z7v1g3pNVNzqE1hRuZsE/mtHNow=; fh=rqHW7NazYv3wAmgqDKAbZUXWTmf0VaM5epB9R4zfTUE=; b=oH9/jSbkDwE0MuaM43roUgp8dId8jGXrzAwmyhw+byAx7C+OdNZRo4rWBRRmgEZkIN jKAWI316x9vQVV5O9vxclwXmLjNFeOAgymFgNvHLG3TlcDhsZinGNzE9BhVeyFXmBVr8 yd88PmvT/6v9F5kG/kqoQvCZa8bIx2d/DTcSGNaFI2gDuBQHBOlYKtk4LVTmbFUFc26q YE44fUJ4gK0Kc1zMmEgh27muc+DpCvy7U5dF7Z7CPvaA8TkJOCoCR0gMohTpWQpeoe2A 6CpZoNVkxxkfD3Rq2WE1qB0EtYe3GUEq8SO+KQ4RMKdkJkkxvjl+VFkUFnBnIr+q+5YL pnHA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OAkv1vKl; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-69364-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69364-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 h7-20020a170902f54700b001db75aa7f41si439347plf.149.2024.02.16.13.25.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 13:25:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-69364-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=OAkv1vKl; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-69364-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69364-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 41790282638 for ; Fri, 16 Feb 2024 21:25:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 09B74146900; Fri, 16 Feb 2024 21:24:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="OAkv1vKl" 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 6C8A6146003 for ; Fri, 16 Feb 2024 21:24:52 +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=1708118692; cv=none; b=CDOkZRtjo2lfeMvvVLDLMuJZzKuyW/KFIQC4kFk8Jsrng1ysyCDkO3wL5eNDf6TNJD6z2FjDcs/sYtZmIMqg9xfowcoQMyRN7q7QNFte01UPC5N7Pe83tnrY5r9ZtvKd+7akTWet+rNDydVriJS8TX4Wgt/AEbNbmO1uNuSqsXs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708118692; c=relaxed/simple; bh=1i+pVhlJw8ZeK4z5/rWVxY4m52zCv0TCoSsszJOhmhM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=BB26VqhgziP1xV8JQjbKKI1J59vEpge1lkLZlL33X9mIGFU5A4iDnoDCzC+idHUboH12QzW2KSm1y0DyCCoLo1/DMBPynorz4ztTjPjUXaa8dBUQX3bD1jz1pGbCP6kRYEffIBM9nkfqnaxBq+EVqO/AVSP5yHmRw2fEMb7S9O4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=OAkv1vKl; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id C1906C433F1; Fri, 16 Feb 2024 21:24:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708118691; bh=1i+pVhlJw8ZeK4z5/rWVxY4m52zCv0TCoSsszJOhmhM=; h=From:To:Cc:Subject:Date:From; b=OAkv1vKlJ8174j6KWIriPqCu4xUhlEMrQY5j5RML+usHREDTOS7T9766wI/+8lafH nA7hTqmMcdl+MUEX50CftxdNsbRCKnT/k2ncxCxzv0InZMOHAz07l+SbukuXn2HCek ubNgjoro7Bog802NVnIkUUzeOk1E3KFQJq6cyMMvTZ+bseWip6niSkR3PRlJ2kHvDh YECZr089G2MNp1c7u8GsU+wtqXJ5fKrMY2h2c+upsYJmvA2AGwgzzGrYSU4S2qIoUp CH/kytN5PQkLNmyTMkcr3g7xMwVzprgNW493xTaVIxTpv7lM4JzbhdsMCH+eE9ISfw UsOJA6LDkm2Xw== From: Jaegeuk Kim To: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Cc: Jaegeuk Kim Subject: [PATCH] f2fs: fix write pointers all the time Date: Fri, 16 Feb 2024 13:24:50 -0800 Message-ID: <20240216212450.31162-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: 1791092281860744894 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 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)