From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 977B1C3F2D1 for ; Tue, 3 Mar 2020 16:43:27 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 51AC0215A4 for ; Tue, 3 Mar 2020 16:43:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="XQRYOUtg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 51AC0215A4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C79B06B0005; Tue, 3 Mar 2020 11:43:26 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C2A5E6B0007; Tue, 3 Mar 2020 11:43:26 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B3FE46B000A; Tue, 3 Mar 2020 11:43:26 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0041.hostedemail.com [216.40.44.41]) by kanga.kvack.org (Postfix) with ESMTP id 99F336B0005 for ; Tue, 3 Mar 2020 11:43:26 -0500 (EST) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 53B3E6C1D for ; Tue, 3 Mar 2020 16:43:26 +0000 (UTC) X-FDA: 76554621612.04.back61_75332b5e3cf5f X-HE-Tag: back61_75332b5e3cf5f X-Filterd-Recvd-Size: 2685 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf18.hostedemail.com (Postfix) with ESMTP for ; Tue, 3 Mar 2020 16:43:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=4K9teVxOkEOyXTtctAJbU/3WG4+bePUoiy0aSqM/mWU=; b=XQRYOUtgm8kvEdVHlc1iBpqnQx PPZB66OYtNnUCx6VAayoHbugBVopjwjmJRyIWDt4ENOWPeGrnb1Mf2+OccRa8J1rTnSCN/1mJNMvy LvrcncqktSCcKShlZOUmuKGdq108N5rThd6u/eIkk083kcy3/t9H5Um+wuXYloHugBs3uAxzgEOsK RjrUNJet8auOJqYuj7h9idaev8q9TeM7SsVam+Ib8oas1xNH1DwRXmOHuHn6YaXKz2i9xDjeJw6sJ BuA/Hmyka/TibjoGPrzbcHwHK4UJIysq3IKojCyrETM4thyGT1dWk0w2wPq43kCCpSF7iyHDBH5dy 98zWm44g==; Received: from willy by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1j9AdZ-00012M-Ci; Tue, 03 Mar 2020 16:43:17 +0000 Date: Tue, 3 Mar 2020 08:43:17 -0800 From: Matthew Wilcox To: Xianting Tian Cc: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm/filemap.c: clear page error before actual read Message-ID: <20200303164317.GS29971@bombadil.infradead.org> References: <1583248190-18123-1-git-send-email-xianting_tian@126.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1583248190-18123-1-git-send-email-xianting_tian@126.com> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, Mar 03, 2020 at 10:09:50AM -0500, Xianting Tian wrote: > This patch is to add the calling of ClearPageError just before the > actual read of read path of cramfs mount. Thank you for your patch and your analysis. I concur; an error set on a page will not be cleared by doing a subsequent read. This is probably an oversight; in generic_file_buffered_read(), we do: ClearPageError(page); /* Start the actual read. The read will unlock the page. */ error = mapping->a_ops->readpage(filp, page); and also in filemap_fault: ClearPageError(page); fpin = maybe_unlock_mmap_for_io(vmf, fpin); error = mapping->a_ops->readpage(file, page); That said, a freshly allocated page will not have PageError set on it, so I would prefer to see this: /* Someone else locked and filled the page in a very small window */ if (PageUptodate(page)) { unlock_page(page); goto out; } + ClearPageError(page); goto filler;