Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp172496imd; Wed, 31 Oct 2018 16:46:48 -0700 (PDT) X-Google-Smtp-Source: AJdET5fqwhMMmiJpLSlz6/+RXa+GT779N1Ve4xUW/ubmBMNM+jKiKiWSgx6g3UmfgP4lN8A4P72a X-Received: by 2002:a62:5919:: with SMTP id n25-v6mr5287965pfb.176.1541029608485; Wed, 31 Oct 2018 16:46:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541029608; cv=none; d=google.com; s=arc-20160816; b=wolXOQZRTZOCf7z9sE/Ghcz68/bRQlJvCTeacnQ7JArfNbkhmU72lMV+5TKsUUUAnt pHX6m2i7/WlYCujJR/n8fbj32XhI25uU4KK/xXBb8H3K/ub/vyUy17dPzRv3mVU3tMYt h6o1XNqqdme3jVCHj6w/6f46kBZPRUydqkOVyLdH5Nscs1HKJ4Y1FSmh9NVO2quNrpd2 Wogt7r6LJEQr+zV8unpSvCsbTKQdaqcM90N+PDxLvbq4RzpuXtSAl81vHrUHx2uT0M68 6bKOBDxIuG8l8SMhXAnh5uomD9LGkuQPErfoOEA4aP6bNKPpt+0g4lkbW0AEN3poC6PO aEpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=LgSz/fYl9qItvbJXnqxFGpeMe6Km1iYGebX31CHyg2o=; b=C2aC+8ugIFiNRqrYyiTnB5cg4cPrRhcqe9u5aS4K0IOPGFmX2iCJ3YpOH1sgq5Gikn oUV4mAqq+m9yVC6HEHttybmQrC6f9BCy2h1J0cWVV6ean0Haq2QmDZbHdZohj3Jy809n 4NOpdZIMtUcP8eT/KxQslXLAaUJnzfHb6xW7skYXEpPRpPad5CYlXm2y72NduW9SWfQC Uhyuu7Kyt8lshJ/BIvCZ2/fPz8c9H24WoajTxKB4FmzjNAJx4UdWBG2CBZ58wD0b+s8T Z4T0QtcXsF2yHx5Fs+ykESH2qLFOnDSZMw48C49YxwGE5gXU5+iFeTVEQuft8xWND/PJ Q5sA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="I3ICEI/2"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y5-v6si24910743pgv.38.2018.10.31.16.46.33; Wed, 31 Oct 2018 16:46:48 -0700 (PDT) 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="I3ICEI/2"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729289AbeKAIpW (ORCPT + 99 others); Thu, 1 Nov 2018 04:45:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:55308 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728918AbeKAIH3 (ORCPT ); Thu, 1 Nov 2018 04:07:29 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4BE9620821; Wed, 31 Oct 2018 23:07:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541027238; bh=b9LSd88zp3hEsCbEGEp8oGHOania1pQhi8BKl6FPxSs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I3ICEI/2XEo6Oy6WhMEJebyOKfZpgbhHT9lvQNc9vw6e+k0Sge9TAmZC3Qr25STpG PmzxlL4Z2f9eOJryTDvmFDBMLcjdAIWGCVEZTNpJIk7QKkBjTnVA/zEKC+zxDHyNVq EqxaslVZ1+ubV+zQlJ8w1QIxVQWyMnFf+3BnjbRo= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jaegeuk Kim , Sasha Levin Subject: [PATCH AUTOSEL 4.19 107/146] f2fs: clear PageError on the read path Date: Wed, 31 Oct 2018 19:05:02 -0400 Message-Id: <20181031230541.28822-107-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181031230541.28822-1-sashal@kernel.org> References: <20181031230541.28822-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- fs/f2fs/data.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index cd5d53353a61..f79fb3aa5ae3 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -80,7 +80,8 @@ static void __read_end_io(struct bio *bio) /* 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 inode *inode, struct page *page, bio_put(bio); return -EFAULT; } + ClearPageError(page); __submit_bio(F2FS_I_SB(inode), bio, DATA); return 0; } @@ -1565,6 +1567,7 @@ static int f2fs_mpage_readpages(struct address_space *mapping, 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: -- 2.17.1