Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp6262434rwl; Mon, 9 Jan 2023 06:19:09 -0800 (PST) X-Google-Smtp-Source: AMrXdXulbDA2mwFl8HJpkq0h5NrfHwexxp8Ymp52ZUKt14dzJy5r3W4VjpyHpp97wSsxWkcnXyWr X-Received: by 2002:a17:906:7714:b0:829:6064:bc52 with SMTP id q20-20020a170906771400b008296064bc52mr48981285ejm.74.1673273949153; Mon, 09 Jan 2023 06:19:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673273949; cv=none; d=google.com; s=arc-20160816; b=zXHsWKNt3MBpLuqT6P2xEQIQt6U/cQtqyXmiiqvPISTzokFRU2mH+Oo+ppqIQZZ0QV x0aGMfTMR4YZGxldw2QBpQmo3ym0DJqUHZs3VdUtRELSRtHWgXRXe0sccSk5aI08jQzW mb1l286+CzHUQBhCsye3EBWxupsHFy8RfAkj1wzfvzHnfnSs6lwUET8ApYUQyBTe+3k4 LP9kNHE0CmL5AfNnnLqhNOyFD6EldOdSnEBMFw9toNX80TVk6wylKSDQocSt5xT6aIgL Fvhfuefpz4P5XTqDOlNQjfe48LemMgRElBvlxGMop3ZnmchzxIpO53ijDzWWnkQShVuY usLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=4fPc+b48YVFON+GFi5+tyom3A+8g29LdvgwOn9C6KLA=; b=DoKtDwMclcTkBHs/p/j+fkRyqMN22dc9hWzEm85KRNaUwYP7BT8ZNXmMlWXWPdmADe RgOE5PwKX0aFVX2LWaGFeWQtJe4Z0m76wi6bH/6AdIYcZov4hdiesj0WkTSh0WiM7xWc S2EGV6YCpPje7i5Is6mHIJjJItMCzTjXG4fvTdfemj2O9qA4AaJzS+6xuDTqRUegTsJb EwwzqchsIoqqHVZ2XCK2hTYsi6BhjdtjYCRyo2xskZXHIZWm9epABQosChAiOJhv2a+h d5cHp2JF6ro6whjTf71gdBG8l6VIDZl11rBRFpcUQATkLfqruQKIFH56dTiYVi9SCALB 70HQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=Jo9RnxR7; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dn21-20020a17090794d500b0084b9ac8f8a3si10152507ejc.836.2023.01.09.06.18.56; Mon, 09 Jan 2023 06:19:09 -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=pass header.i=@infradead.org header.s=casper.20170209 header.b=Jo9RnxR7; 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 S233660AbjAIOD4 (ORCPT + 53 others); Mon, 9 Jan 2023 09:03:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237296AbjAIODY (ORCPT ); Mon, 9 Jan 2023 09:03:24 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E1A7218D; Mon, 9 Jan 2023 06:02:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.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=4fPc+b48YVFON+GFi5+tyom3A+8g29LdvgwOn9C6KLA=; b=Jo9RnxR7WL5y4iij9mTfw8hQBF jLg2xGBamflC+5gdBYgPQ+sg5qhQcIjVRfwthweBshVo7YBpxRX2QxbxxbSuI8RDpw4JcQIf5V37j FVIiXiObAfc3E6/xr7FNpma61QH4zXzNgZshZSCvbHTww8Gdh7IFK8+F+YD3D8NAO0fP6fPFwK6G2 9PHXjQa7A49GE9JIxsoc9n4QtUGD4BVTuysKX6yoea6Q5ZFfPMQjGNMvg9jqTrqdXjT+b/GjHh7TZ 7frbhhF9akLeQ2uOJPcHfEIeUfuMGB3k5aNDW44L8QpFkSuKBZDAdnQGlpXaKZyCh1TX1Fv+Agd5H vg1C5Dow==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pEsji-002KvU-Ld; Mon, 09 Jan 2023 14:02:50 +0000 Date: Mon, 9 Jan 2023 14:02:50 +0000 From: Matthew Wilcox To: Jeff Layton Cc: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Christoph Hellwig Subject: Re: [PATCH 02/11] filemap: Remove filemap_check_and_keep_errors() Message-ID: References: <20230109051823.480289-1-willy@infradead.org> <20230109051823.480289-3-willy@infradead.org> <36311b962209353333be4c8ceaf0e0823ef9f228.camel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <36311b962209353333be4c8ceaf0e0823ef9f228.camel@redhat.com> 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 09, 2023 at 08:48:49AM -0500, Jeff Layton wrote: > On Mon, 2023-01-09 at 05:18 +0000, Matthew Wilcox (Oracle) wrote: > > Convert both callers to use the "new" errseq infrastructure. > > I looked at making this sort of change across the board alongside the > original wb_err patches, but I backed off at the time. > > With the above patch, this function will no longer report a writeback > error that occurs before the sample. Given that writeback can happen at > any time, that seemed like it might be an undesirable change, and I > didn't follow through. > > It is true that the existing flag-based code may miss errors too, if > multiple tasks are test_and_clear'ing the bits, but I think the above is > even more likely to happen, esp. under memory pressure. > > To do this right, we probably need to look at these callers and have > them track a long-term errseq_t "since" value before they ever dirty the > pages, and then continually check-and-advance vs. that. > > For instance, the main caller of the above function is jbd2. Would it be > reasonable to add in a new errseq_t value to the jnode for tracking > errors? Doesn't b4678df184b3 address this problem? If nobody has seen the error, we return 0 instead of the current value of wb_err, ensuring that somebody always sees the error.