Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1913879pxb; Thu, 16 Sep 2021 20:05:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTIY4OIGSclMdZSNJ1O4M+eVGvdisI5jfMoutrtHaptRWhpaUwAexaJjOXI2yLmSU04TmH X-Received: by 2002:a05:6402:1ca4:: with SMTP id cz4mr10181825edb.205.1631847941479; Thu, 16 Sep 2021 20:05:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631847941; cv=none; d=google.com; s=arc-20160816; b=W83hn/ex+eMwSTIUzC46E/GehQrL7ACsUpLX3Te9dU0EAuFk6bjc/O1p0xkdWRSMIP b5ecvtyDCnykkDNbeCfQZq6V2vqWaP2IjV9yfAW36RvdVmmHm/InTAiPxZ8eks2atUYe a1b740dp7e9RG+YlyJyky01taM+rw8eiSJkm7VyBr9sheKgrgC4ahU6rXAcZi2FOZ0gV vr2fTPoqA6RqeTJ+VaQc3e3uHbPOKO5hrfLm74EAmj8EgfWrFar9JEjgjuU5WyQo5rVi gZWHUv6wpi1KhbE551J96gXLohReuIvTZlqPtkcVbVc8dfI/bjpngjjQzHiUoUbJUi1X TUyw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=D5DrtK4YnLtji5NrUvwIpcoHVhA1Y08EJD/xRsfdYQ4=; b=kk/8ggGa66x/UEJqvDa/3+aIurPim35LpNU9m1EJgMpKhNAXodmss3gHH0xIJRu+50 rXg1T7G+EKHUYNQQp8/9rtJNCajhfqCa4oQEbiFnJYa4posoRC98zv5ReKZl1AxxpCDT h4Ig++edHwmvVJlHmp3m43W7Qys+uqQ6ydcRy+bOdHUU6QAaJ5w3rUq56+d1I4qi4fJd bqbjb3MGU67wsheQ+kS3OtqUPkOL+DmciNzd609g9o+xjwzhviOnVo63mFs5cNJI816N 8MZDqoq5rgJDQYG2vTTqzz602c69SBqoYjxytng9xPYMtCVaey2f45MsDz2weDUUGQ6h sfaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fcZOiHLx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bz6si5624096ejc.374.2021.09.16.20.05.16; Thu, 16 Sep 2021 20:05:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fcZOiHLx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351959AbhIPRUD (ORCPT + 99 others); Thu, 16 Sep 2021 13:20:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:37566 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350742AbhIPRMG (ORCPT ); Thu, 16 Sep 2021 13:12:06 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 64B606140B; Thu, 16 Sep 2021 16:38:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631810311; bh=nddOb52Hhn8RUwoUAbILSuwemUiC19xRPuibnjId1js=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fcZOiHLxRbmLqwtWFcHeQ03Y1pbsWEid7OWjmCl95eqdwAwaiM/Py8HdnSwZoVyMm AX8bxsJcJ8x3/ZF8qTqZhIe9+PFeD/fcMgbDDDAtdAGKTHIVccS67oqUHNna2eO3II R0v+xRhoCThvv2hsfn5inI9WNP4+D+sgXtGUAml8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chao Yu , Jaegeuk Kim , stable@kernel.org Subject: [PATCH 5.14 062/432] f2fs: lets keep writing IOs on SBI_NEED_FSCK Date: Thu, 16 Sep 2021 17:56:51 +0200 Message-Id: <20210916155812.887988478@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155810.813340753@linuxfoundation.org> References: <20210916155810.813340753@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jaegeuk Kim commit 1ffc8f5f7751f91fe6af527d426a723231b741a6 upstream. SBI_NEED_FSCK is an indicator that fsck.f2fs needs to be triggered, so it is not fully critical to stop any IO writes. So, let's allow to write data instead of reporting EIO forever given SBI_NEED_FSCK, but do keep OPU. Fixes: 955772787667 ("f2fs: drop inplace IO if fs status is abnormal") Cc: # v5.13+ Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim Signed-off-by: Greg Kroah-Hartman --- fs/f2fs/data.c | 2 ++ fs/f2fs/segment.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -2498,6 +2498,8 @@ bool f2fs_should_update_outplace(struct return true; if (f2fs_is_atomic_file(inode)) return true; + if (is_sbi_flag_set(sbi, SBI_NEED_FSCK)) + return true; /* swap file is migrating in aligned write mode */ if (is_inode_flag_set(inode, FI_ALIGNED_WRITE)) --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -3563,7 +3563,7 @@ int f2fs_inplace_write_data(struct f2fs_ goto drop_bio; } - if (is_sbi_flag_set(sbi, SBI_NEED_FSCK) || f2fs_cp_error(sbi)) { + if (f2fs_cp_error(sbi)) { err = -EIO; goto drop_bio; }