Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp3595629ybf; Tue, 3 Mar 2020 08:45:42 -0800 (PST) X-Google-Smtp-Source: ADFU+vuwcHSi3qVbDYXHnJTihsXxPR/jFuCFDXxBXyTumC4FVxd7pOK7k0ij0kWi3W0Xzm/uKB0T X-Received: by 2002:a05:6808:658:: with SMTP id z24mr3123019oih.91.1583253942514; Tue, 03 Mar 2020 08:45:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583253942; cv=none; d=google.com; s=arc-20160816; b=mBGKArWaLr/16BCT1ZbgTOmQOYaK/j5vNULPFuvr+7j4UUFjiF0koznVHrJQQwadr4 SSquWCzgYM7n7EhWP/Evz6rR/NDBt8cIqWaUrIOXVbSLkOKChSe0nBxqq7H1DoORwQ/f V7wmOpMyxUmqPm3mFEoCY11ZVbZiWmDlBBnpHtaJJoyJnZipBN/K5LKaegQHYDb4i2yo aM/9+n/aAb+FKTtAAN9qUw6M0F/H3dfPjMcfAqv5MzJKL2C78Na8bvFQjghAJFjrL0CY wRU6D93gTLy4XzJwzXlg9YHo4JET9OUWpd2G1vPquMuRCfau25y6BWvzBWvtam8/NQKf +kmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=4K9teVxOkEOyXTtctAJbU/3WG4+bePUoiy0aSqM/mWU=; b=Mup/B87YqN+9deXZ+HtYNqvcgtoDMfsmVbriqaQb7AKuG/DSOeqTccRzfrPCb1rc3K CkxKelXs93H0xMiHxpuQBalC7tcGedcKs2EdVo3Vmhs0X9eYZh53dHH88siKdUqkk2jV lAfn+1Z3uFCfjECw9LvdsMMrscI8uG/A6mv9nUt7Rgbracq/cXjEruqGo9xamx60o4Kq j7u0H75a/hvPRCKFDXOCB2LdTrGKHnbfOupj9mrkN/3yo55ksMIVdsZ5KA/AB1HsoCBz MSTL4mXFMKO6ugg16UX5sZpq1sszN/Um+x4zkyiOPtm1IEmlGb3mzF4LP+Px7XgL52p1 hHOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=XQRYOUtg; 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 g3si8814532otg.179.2020.03.03.08.45.29; Tue, 03 Mar 2020 08:45:42 -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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=XQRYOUtg; 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 S1730028AbgCCQnV (ORCPT + 99 others); Tue, 3 Mar 2020 11:43:21 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:44426 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729335AbgCCQnU (ORCPT ); Tue, 3 Mar 2020 11:43:20 -0500 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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;