From patchwork Mon Jan 9 05:18:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 40667 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1984987wrt; Sun, 8 Jan 2023 21:20:02 -0800 (PST) X-Google-Smtp-Source: AMrXdXtfgHKxgFwIdbf/rjZp3coUhwWYz33aiy3YMYZ9GxMafAQQ2IG0A1esefFGeopwlrrX3rUH X-Received: by 2002:a17:90a:4086:b0:226:27c2:829e with SMTP id l6-20020a17090a408600b0022627c2829emr40496570pjg.32.1673241601836; Sun, 08 Jan 2023 21:20:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673241601; cv=none; d=google.com; s=arc-20160816; b=BpUt8FcZNeRlK14SCv/pRjPXzVz79QFda4h6GKUgu5nKmN5nRFKe3RPd18suuZoxe7 9pV76zkmWGQ2mx1qAulE7ezqSGa1AcPs/3N52lF0L0QQx0a4nnhd8VdEPKgrZtD8QzZ8 5scv+U5Ni3BZc5OH6PJRTUDBkBXQBa8Obh3QUNtBRB5wizg8PaV6uHs7zyRX42vpJIbn E1VZpzc0v6Q6Bc4Oo4InWW/2N36Z+6AuJlGTsT4S51euzrCV0K6qX5DiYMQ4uxyqD/a2 VXfJhiYf+UiqGcyCyBuSvVLPZKVQ/GXrsQMs+lAgiDtNZoh2TTVLfR6O5ij0oEjyM3H6 sFoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:from :dkim-signature; bh=/TboxjvLj2LzaTPo6wOwSPdZqcAQLPCIOhhkOsSnAto=; b=stc+iPEZ+Ysz3NwUEEj1q/qn0uC9sEYhEDJzU4YDWgazDjdv34vc1k02H+h0voXrbg yEpzzJUVybyNUCzKzhcpwOrrvMBTQJ8mp03ggnbvnqwSMNj8OGJwCKKR7+xWPfW2IroU vXZTRkGhR0dyWIUo/pnylvZqj2MopIvMRtN+Go+jO82hTfRCPw6aIYkkSXt7iALLTnCC gkBiyeWUFPx6C77M60YsF2f2QL2bpHq/oEtc/BWoLLBjO7qyD1LHEJcqPQyclp0/gRVV owpjDJVlVFVOQKXOAwn6PEo3xdna05G6lDJRsAm0d5JyBL1ZaYiuZaKLVZ89+1oVHzpX tThQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=nb4a5StF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d7-20020a631d47000000b0044fb332e9c2si4362786pgm.560.2023.01.08.21.19.49; Sun, 08 Jan 2023 21:20:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=nb4a5StF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236502AbjAIFT0 (ORCPT + 99 others); Mon, 9 Jan 2023 00:19:26 -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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754520986063793794?= X-GMAIL-MSGID: =?utf-8?q?1754520986063793794?= 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) Reviewed-by: Christoph Hellwig --- 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); }