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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8134AC54EBD for ; Mon, 9 Jan 2023 05:19:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236515AbjAIFT3 (ORCPT ); Mon, 9 Jan 2023 00:19:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234729AbjAIFST (ORCPT ); Mon, 9 Jan 2023 00:18:19 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D2C4DDEBB; Sun, 8 Jan 2023 21:18:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=/TboxjvLj2LzaTPo6wOwSPdZqcAQLPCIOhhkOsSnAto=; b=nb4a5StFHAwGzV5DL8zXSWnxJw zX600UOuwgmVsgmjNFBmqtMFxS3xy8oIktPbQkH8TRK7ibTOd9FSpSh760MmC9CNX44HBqsWmi/N/ UDlCxOA7LujBoWs15c9vzwZdsHq5P+N6jwyH3KWvAvYzHO2vlJFU9V1QNqyBGQRrdrZwNcdugBvtP 3zAHtqfRrI9/eo03r3LBI3D0DlE6gp7IrVEkLzTfqFcNiqtxYLZGQs5aDUuOlcHvk31wtghpU8Omp 15oltxC23wFZYvXnu2blmo/TycCTrH3pEYJvW4N4bLOfpWYrtEf0G6ZhxHe1M6ij03Kc3FJ4BHc5S 19VIUrTA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pEkYC-0020wm-NL; Mon, 09 Jan 2023 05:18:25 +0000 From: "Matthew Wilcox (Oracle)" Cc: "Matthew Wilcox (Oracle)" , Jeff Layton , linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Christoph Hellwig Subject: [PATCH 01/11] memory-failure: Remove comment referencing AS_EIO Date: Mon, 9 Jan 2023 05:18:13 +0000 Message-Id: <20230109051823.480289-2-willy@infradead.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230109051823.480289-1-willy@infradead.org> References: <20230109051823.480289-1-willy@infradead.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The EIO is now reported to every caller which has the file open on the next operation which returns an error. We obviously cannot check whether the user took action correctly on that error, but we can remove this comment as wb_err is never cleared, unlike AS_EIO. Signed-off-by: Matthew Wilcox (Oracle) --- mm/memory-failure.c | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index c77a9e37e27e..1a1c66f7e5dd 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -992,34 +992,6 @@ static int me_pagecache_dirty(struct page_state *ps, struct page *p) * who check the mapping. * This way the application knows that something went * wrong with its dirty file data. - * - * There's one open issue: - * - * The EIO will be only reported on the next IO - * operation and then cleared through the IO map. - * Normally Linux has two mechanisms to pass IO error - * first through the AS_EIO flag in the address space - * and then through the PageError flag in the page. - * Since we drop pages on memory failure handling the - * only mechanism open to use is through AS_AIO. - * - * This has the disadvantage that it gets cleared on - * the first operation that returns an error, while - * the PageError bit is more sticky and only cleared - * when the page is reread or dropped. If an - * application assumes it will always get error on - * fsync, but does other operations on the fd before - * and the page is dropped between then the error - * will not be properly reported. - * - * This can already happen even without hwpoisoned - * pages: first on metadata IO errors (which only - * report through AS_EIO) or when the page is dropped - * at the wrong time. - * - * So right now we assume that the application DTRT on - * the first EIO, but we're not worse than other parts - * of the kernel. */ mapping_set_error(mapping, -EIO); } -- 2.35.1 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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 342D7C5479D for ; Mon, 9 Jan 2023 05:34:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C4C878E0002; Mon, 9 Jan 2023 00:34:57 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BD3FC8E0001; Mon, 9 Jan 2023 00:34:57 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A745E8E0002; Mon, 9 Jan 2023 00:34:57 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 934DB8E0001 for ; Mon, 9 Jan 2023 00:34:57 -0500 (EST) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 6CDC1A7DA6 for ; Mon, 9 Jan 2023 05:34:57 +0000 (UTC) X-FDA: 80334146634.04.D78402A Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf30.hostedemail.com (Postfix) with ESMTP id EDE188000D for ; Mon, 9 Jan 2023 05:34:55 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=nb4a5StF; spf=none (imf30.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1673242496; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=/TboxjvLj2LzaTPo6wOwSPdZqcAQLPCIOhhkOsSnAto=; b=iPqVKDVV+5r8JdmEeGgTiKbGTsCMh3rpopEt3MspSQ9iWorhs+imkL56f0GWzcZmijMnFh MEm7x52kq3uAzYQI1ETjE4P/GGZGUgPOo/2b/zBK6qTipScU9teofEI/qrGSPl83vaowa3 0f60m58qp3Gm/tcl3d/v+ycPO8P8hzs= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=nb4a5StF; spf=none (imf30.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1673242496; a=rsa-sha256; cv=none; b=8r/xFmN6kdmxuZh32M/KZwJmimeppgYWWFPx8I+Mzb+QdyH5Cg9fP2YOX3BKtgv1k9ylC2 fXIOfReamZXomxvn/BFQFuujjbMwLZPaJMwg0qmjJe9JW4l3g3dYe8DgMBrfdbYFPN+f/Y 4NQtozgOMRhCebQj0G10+/zx5oHkpmM= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=/TboxjvLj2LzaTPo6wOwSPdZqcAQLPCIOhhkOsSnAto=; b=nb4a5StFHAwGzV5DL8zXSWnxJw zX600UOuwgmVsgmjNFBmqtMFxS3xy8oIktPbQkH8TRK7ibTOd9FSpSh760MmC9CNX44HBqsWmi/N/ UDlCxOA7LujBoWs15c9vzwZdsHq5P+N6jwyH3KWvAvYzHO2vlJFU9V1QNqyBGQRrdrZwNcdugBvtP 3zAHtqfRrI9/eo03r3LBI3D0DlE6gp7IrVEkLzTfqFcNiqtxYLZGQs5aDUuOlcHvk31wtghpU8Omp 15oltxC23wFZYvXnu2blmo/TycCTrH3pEYJvW4N4bLOfpWYrtEf0G6ZhxHe1M6ij03Kc3FJ4BHc5S 19VIUrTA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pEkYC-0020wm-NL; Mon, 09 Jan 2023 05:18:25 +0000 From: "Matthew Wilcox (Oracle)" To: Cc: "Matthew Wilcox (Oracle)" , Jeff Layton , linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Christoph Hellwig Subject: [PATCH 01/11] memory-failure: Remove comment referencing AS_EIO Date: Mon, 9 Jan 2023 05:18:13 +0000 Message-Id: <20230109051823.480289-2-willy@infradead.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230109051823.480289-1-willy@infradead.org> References: <20230109051823.480289-1-willy@infradead.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Stat-Signature: ynqre177dm56sq6747ebnstyttfsgdbh X-Rspam-User: X-Rspamd-Queue-Id: EDE188000D X-Rspamd-Server: rspam06 X-HE-Tag: 1673242495-61316 X-HE-Meta: U2FsdGVkX19z7/vlNUrlG/yGtTGR8omJdBwMdRvBZQiXqVjMxhaQRDkdd06IrUQ0tsX7UC67MCMbsCWP0B/ZGrv9RnuolL8/nS0Byp2s3BCE+yGrsNgA4Zt8IV4N9TkQI91HTNjaGCNxNs8ZlARx0Jsvq9LBo8NgSVcjYcMid+r3E4q4DXz6r1P3lGaud/L5Qnrq60cTUeXwtX3QvuY1lfwg6CAUrXma8qk2Ylj+8mRhaSirwLVCebWh2+0PViYHPgyb4Eh0szgsS/ZAsHKeEi9XihO4aCSOOjIpUBqVseDc+bdlGuosXFvXRv8NgL+cqj+D9Dtpphus7EKbHmXV4QZV+fcs+l6D4xHt7yKZh4DN8t8tQ4LOT3SakMJqYsigrYkuYRBxtc7JPkDsKVY8D//tvaafefNvdtXukIjD7sasezzpfX0XIx0usxuFBdmuk7axS8xJ8vg2vEG2n9x+6PzydiF9Y3ciWp/LWy74EBKBNnScPs4hOmz9dIChI2YyFHP9PHjDPO/Aa2DWYleEDEReTSJL6ijGrM1VoixQg8ALyAl2en0vL8IQzb4LLXWN3wz8BPm6PiOwppYXOaiPRIeeCsd7/eky/ZZ60vKpDEwg4m89BeN6AcubqGOc8k+1WGRlDI7pXyf//WslDSaZm12F3EN5Vj+vQX3nJh/mMaTlf/3p2HlDcmoerXa3bv0OYg94vm4VMgXH9U51/NGO6QLglVyf3nbvAdqzWxd7V7Pe064S+uDCpZSDzUf1DDx8tfwI4iSQ0pBU5bjitM8sooN2vtc26AIikYoIf/Ecd92cuplvcObdU3nwlKStVU2IMi9ZKjW94v7Urve9h4FqXQg9BHk3k42nJN115j05PokPtIn9bnz6WkTrvmw028LpZXywZyhGEunZaX9MZ/SpfJdLdc51YkkW6BXE/GvVe8q2Jda6HPE3ww== 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: The EIO is now reported to every caller which has the file open on the next operation which returns an error. We obviously cannot check whether the user took action correctly on that error, but we can remove this comment as wb_err is never cleared, unlike AS_EIO. Signed-off-by: Matthew Wilcox (Oracle) --- mm/memory-failure.c | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index c77a9e37e27e..1a1c66f7e5dd 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -992,34 +992,6 @@ static int me_pagecache_dirty(struct page_state *ps, struct page *p) * who check the mapping. * This way the application knows that something went * wrong with its dirty file data. - * - * There's one open issue: - * - * The EIO will be only reported on the next IO - * operation and then cleared through the IO map. - * Normally Linux has two mechanisms to pass IO error - * first through the AS_EIO flag in the address space - * and then through the PageError flag in the page. - * Since we drop pages on memory failure handling the - * only mechanism open to use is through AS_AIO. - * - * This has the disadvantage that it gets cleared on - * the first operation that returns an error, while - * the PageError bit is more sticky and only cleared - * when the page is reread or dropped. If an - * application assumes it will always get error on - * fsync, but does other operations on the fd before - * and the page is dropped between then the error - * will not be properly reported. - * - * This can already happen even without hwpoisoned - * pages: first on metadata IO errors (which only - * report through AS_EIO) or when the page is dropped - * at the wrong time. - * - * So right now we assume that the application DTRT on - * the first EIO, but we're not worse than other parts - * of the kernel. */ mapping_set_error(mapping, -EIO); } -- 2.35.1