Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1620168pxk; Fri, 2 Oct 2020 14:33:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyYc2fZFIesYKc7mwJNGvxe8EtZeVTsYkS8cHob9u4/vg45vHeTfFkpiTo1/AMgwgg6RwrI X-Received: by 2002:a17:906:3056:: with SMTP id d22mr4128001ejd.495.1601674425829; Fri, 02 Oct 2020 14:33:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601674425; cv=none; d=google.com; s=arc-20160816; b=J+FA6bTZm86o/Q+Attn+JerN+SF2csaJFMAJheCQIn0NJKshQDt2UzcG7vTn/gOmw7 YXhJzpzAMOzFDC1cVnrqQ6alAOfE/awvbOhYEMa3gcaypxtNfXqNyFlrmZ25f3Lol7oH PI4QfcHz2MA+TVl/TloMsTYqxgHHsoBgWXalU5Xk4XLkZ0azbQTzaCWKlhjyVJde6hYK VEqnjn36hGHyDEcodJFfR8hvKPNVYSq5IEJR3EpqScjbUY1piScvP7F1sjPQbp82z6ht 9ZwuIlzOF8POkIdKFBYjDX8qOi7/pPbsBE/Cg3NIkDkiVxn6qDuANC62XC9VR7mDbqbV h6SA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=cXITP5jhssfPcLriSK7Nh9AHnTDT5tOv9r/df9xLyJ8=; b=nDvGxaOt9zPBKYgA2cnjBWErDtkLa1E50zmow7YGA6/HiNh54IAI93D1pg3D6E8Kgm PkBqp8cLzhsdWVDxzjkSnkYE/+73jf+HPtCYSvcN3kuAOUNKoPLGcqrMAn0/J1luLnJ0 OV+QFHpuadAWnTsVLLVQuUSmR/XvzhuR52qJI2ctOS65t6DdjUm4031BW7nA+wbNGJ8x AKfv5WxK+S6zyhFwpPg3IvD5eet3RArdFYjYr3R9VCt8lb2afaLNUJDe+Mx4JK2ZXlDe rPWUY3bQxev7HXSBbub3aF9sgjTxN+bnFiLQ9AdNdI8Vvx3CFYDwfEfP4ELpmjBFRQWw 8okA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=LR7U+bEt; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p15si1795692ejm.293.2020.10.02.14.33.22; Fri, 02 Oct 2020 14:33:45 -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=@kernel.org header.s=default header.b=LR7U+bEt; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725616AbgJBVc2 (ORCPT + 99 others); Fri, 2 Oct 2020 17:32:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:44958 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725355AbgJBVc2 (ORCPT ); Fri, 2 Oct 2020 17:32:28 -0400 Received: from localhost (unknown [104.132.1.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B1B43206DB; Fri, 2 Oct 2020 21:32:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601674347; bh=BXnB7D0dGvSDenDoY22oXd0SzTll4rH2ewFNsGCrSQA=; h=From:To:Cc:Subject:Date:From; b=LR7U+bEt/2/CNKafgRz9yu9mA1CtUmFoFJ3bsUQ4A+2jE3r+O/Mim0orfIExLNY0u wq+A4QhtpDPSXKtSVPIjuNbaoB3Zkq7YCYuT37VAZVOdg7S76w8uOrrqNDzxj//szF UFpZxz8cXufw1DsTb8hN5+RY0UAv7vVBxlQbPgME= From: Jaegeuk Kim To: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, kernel-team@android.com Cc: Jaegeuk Kim Subject: [PATCH] f2fs: f2fs_get_meta_page_nofail should not be failed Date: Fri, 2 Oct 2020 14:32:26 -0700 Message-Id: <20201002213226.2862930-1-jaegeuk@kernel.org> X-Mailer: git-send-email 2.28.0.806.g8561365e88-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Otherwise, f2fs can break the the consistency. (e.g., BUG_ON in f2fs_get_sum_page) Signed-off-by: Jaegeuk Kim --- fs/f2fs/checkpoint.c | 9 +++------ fs/f2fs/f2fs.h | 2 -- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c index f18386d30f031..7bb3a741a8f16 100644 --- a/fs/f2fs/checkpoint.c +++ b/fs/f2fs/checkpoint.c @@ -110,15 +110,12 @@ struct page *f2fs_get_meta_page(struct f2fs_sb_info *sbi, pgoff_t index) struct page *f2fs_get_meta_page_nofail(struct f2fs_sb_info *sbi, pgoff_t index) { struct page *page; - int count = 0; - retry: page = __get_meta_page(sbi, index, true); if (IS_ERR(page)) { - if (PTR_ERR(page) == -EIO && - ++count <= DEFAULT_RETRY_IO_COUNT) - goto retry; - f2fs_stop_checkpoint(sbi, false); + f2fs_flush_merged_writes(sbi); + congestion_wait(BLK_RW_ASYNC, DEFAULT_IO_TIMEOUT); + goto retry; } return page; } diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 9d58fd5dae139..d905edb42c327 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -595,8 +595,6 @@ enum { */ }; -#define DEFAULT_RETRY_IO_COUNT 8 /* maximum retry read IO count */ - /* congestion wait timeout value, default: 20ms */ #define DEFAULT_IO_TIMEOUT (msecs_to_jiffies(20)) -- 2.28.0.806.g8561365e88-goog