Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3482797imu; Sun, 11 Nov 2018 16:07:12 -0800 (PST) X-Google-Smtp-Source: AJdET5fypUIYOPXcJFNe2Qigz1gFtg43QTR5Lp02Pf2id7jcNrdr5jPngeUfSZvxy1OpFWarzHYj X-Received: by 2002:a62:2545:: with SMTP id l66-v6mr18029088pfl.207.1541981232169; Sun, 11 Nov 2018 16:07:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541981232; cv=none; d=google.com; s=arc-20160816; b=KGGBc8zsHv/WnmBrKTxfN887YUA7p1FaQDBexw1xLH3hG0nwkzNdRFVcxUGbT896t3 I5jtT2PDjyOrMPLPbbDraa+VZyno9c6CcTsFIMvBWMECtAvMdfhGOWicAyE83IgXai+0 l66X4qvrpYDT9ZR6dOTzK0YjAanA+lwpHAKeaDg/52HtJAUT5jZKPWvunocMZtQI6uEf X5EixltuB+wflNo2Lk1DzlsSnc1DsZcOlBBV59S8impoMtXtseOalrjl6roRpOQpDfTG 7N2TXWB0QX3WkmevGq8cSLVDFfoGSAdF5whAtt5ufs6Ja5YNKaRf2sG4sE7j7EY2EAbD dYnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ngyyQphuOASKKjieh8VKhn54l8rVvX0OJ+ollo7rGEY=; b=H2YItLSrXnNhaUoLutpo1bC6LFWeurJ60VOJBirtVcoOMw7lvbWjlG8LuYQ4aAmVQG ZPgVp9jspAmvow/aC+jI+5doaSjdg6GqK7Du9JamI7s012yCQwsMpctgebSuZkXFEeNY VQi7IAo8i54O5lcLCIeYE5DfzT27Ln8d7iFbAAI6E1QZYt1lS/j7p5r2csEoVhZwCOHT QjPWKRtZ1Jkld+fjfwfoh+JSIgn3h2Lthw8lqWhRyDd3mzcYv4aPfTaPWAYQJTVZV2/2 OrNlTXT3rvHONvHzmaTyLZJASgwYhnSO/YSDXY5yDULfC6pJ1gT4M01naW8eTULob7gR GduA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1+e9nkXo; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m61-v6si16660186plb.311.2018.11.11.16.06.57; Sun, 11 Nov 2018 16:07:12 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1+e9nkXo; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732072AbeKLJ47 (ORCPT + 99 others); Mon, 12 Nov 2018 04:56:59 -0500 Received: from mail.kernel.org ([198.145.29.99]:33910 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731821AbeKLIRj (ORCPT ); Mon, 12 Nov 2018 03:17:39 -0500 Received: from localhost (unknown [206.108.79.134]) (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 87E0B2154B; Sun, 11 Nov 2018 22:27:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975263; bh=bNCYzD3wkwJztPA6+xq4EeLp8QaA1qkrjH4vNfiCeBU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1+e9nkXoP9ys4z545fAnfe9JD6pfeBLFChf5YN6c7UWSlrjmVljM64OF5qMGK12Fg 9euBwJsLKA/ZQWuhxR35Sv6Gpch84rVnrC8JAZ44zC3gvrcM07nJ3NePo/u9QnJ2OD lsjrOKdfqLoWQMGNobngbmtnkJo9P/uNU6t0dQxM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jaegeuk Kim , Sasha Levin Subject: [PATCH 4.19 152/361] f2fs: clear PageError on the read path Date: Sun, 11 Nov 2018 14:18:19 -0800 Message-Id: <20181111221641.692725018@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221619.915519183@linuxfoundation.org> References: <20181111221619.915519183@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jaegeuk Kim [ Upstream commit fb7d70db305a1446864227abf711b756568f8242 ] When running fault injection test, I hit somewhat wrong behavior in f2fs_gc -> gc_data_segment(): 0. fault injection generated some PageError'ed pages 1. gc_data_segment -> f2fs_get_read_data_page(REQ_RAHEAD) 2. move_data_page -> f2fs_get_lock_data_page() -> f2f_get_read_data_page() -> f2fs_submit_page_read() -> submit_bio(READ) -> return EIO due to PageError -> fail to move data Signed-off-by: Jaegeuk Kim Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- fs/f2fs/data.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -80,7 +80,8 @@ static void __read_end_io(struct bio *bi /* PG_error was set if any post_read step failed */ if (bio->bi_status || PageError(page)) { ClearPageUptodate(page); - SetPageError(page); + /* will re-read again later */ + ClearPageError(page); } else { SetPageUptodate(page); } @@ -590,6 +591,7 @@ static int f2fs_submit_page_read(struct bio_put(bio); return -EFAULT; } + ClearPageError(page); __submit_bio(F2FS_I_SB(inode), bio, DATA); return 0; } @@ -1565,6 +1567,7 @@ submit_and_realloc: if (bio_add_page(bio, page, blocksize, 0) < blocksize) goto submit_and_realloc; + ClearPageError(page); last_block_in_bio = block_nr; goto next_page; set_error_page: