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 BDC70C5479D for ; Mon, 9 Jan 2023 14:02:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EC5F48E0001; Mon, 9 Jan 2023 09:02:50 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E75DE8E0003; Mon, 9 Jan 2023 09:02:50 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D21378E0001; Mon, 9 Jan 2023 09:02:50 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id BF3538E0001 for ; Mon, 9 Jan 2023 09:02:50 -0500 (EST) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 783D5C0A65 for ; Mon, 9 Jan 2023 14:02:50 +0000 (UTC) X-FDA: 80335426500.19.B20B1B3 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf21.hostedemail.com (Postfix) with ESMTP id 5B5B61C0020 for ; Mon, 9 Jan 2023 14:02:46 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=Jo9RnxR7; spf=none (imf21.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=1673272968; 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-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=4fPc+b48YVFON+GFi5+tyom3A+8g29LdvgwOn9C6KLA=; b=57uP3HVM4QbJKlDGamg97ipYbn8MxDQ3HlCMPSEHBDN3m5Q1nlNFnTID5vjc5iQU/772a3 IRZfLwgV94DX+YFvWWqbq8fI2qGJ+rI2ZD36NP37ACA0bfb7wqQ/inkHiS5z9ZdfeZVvNs MUcqilgfKYOFhneEIcSeBWqAYgFqAEg= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=Jo9RnxR7; spf=none (imf21.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=1673272968; a=rsa-sha256; cv=none; b=iIk0n50TGsf80FjJZrdz430PQ4KPWhDFvaLyzAM+wjit6h+o9HdxlMtiyUpU1w+OflbWnM 2BzR0Sjm1Fjq7e+6Q+0DeUOzlWRU1/2HdMESf9UABfRPc2Kv0Mrm3TUEcD/hIi0AvG7Toc wMAVf5mOeZKxtbywPIOgxpEPQr1tCbI= 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-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 5B5B61C0020 X-Stat-Signature: 8mfxbs6jy3ztdz4ktm3ugdaghatugc58 X-HE-Tag: 1673272966-441416 X-HE-Meta: U2FsdGVkX19Xoi/h0QCBGrNmBhKfYSizYHAXswP0Kww1sZN2Kd2U3oi8qqRsuR2IYQxlsQjHLVS5MZdfp54RjHVXp+wJrV43BK2dZU5PBqx6afeggY17MoZZZe7fdbEeNyZPkN1+FT0iotboIpzrXI6fz6zwCQfsI5M4Gqu7mb5dNzcLQ9IjnZV7jZc/o/CqvvP+k9pzAOd2w3mNcnXL/5MKiSdughEVYN9X+Cj2CO/kXimNVyYMiZERGUJNnbcLMY+bs4jYM2tCc02xCc3BuAVv+5EtbRw3m+poSCpuxHHlprBkc3xoSvvX7Qfk1SBc1f8WZhh/T8r+Y+c8TQMyxBUaxG83jI6ig2LstrTLd0N7j8PRfuoqxJSKYoMyxIxn75+/8DvbXG53kAc/LD4CGGq6ERgsEHjBxM1WhxpfRIMur8Tx+r4hYjRGBbPVwuT7z/X2tOJXqtqtc9ZvOD+aiL7Yn9t3ea5KKrXqAZLdHEDZ1UKBQrMFNPJbnaWHKbuiaX4t+E+g24/ORXjK2uxn0JOX5zfMKNqlqjlSHMHdJ2fKp/H4PNuGZ50rxfTA6i3SaejiYOZX3/th1fzv0ZTWcK7jRn3czYWvrW/7F6UgItqEs53BydZsFBpWdmSWA96uBouT58NE58hf0qTVmTFsi5qxjDPByOPbzLk9wVx38uu/y3ULODvwXZ3qFMJ8VaIXU/StS8sNb9E5Ih80Ngt4P13hJhFzVj92t+kcFbyGcanvd7Zel7IHEjAVGYZTGCe8l0vP2e3cl4TCMR7Nl/noeOPvPpqPBYg/+PdI3RXrE7ECJeLHU+7lNLC7jS083AkJBDYHd08Ka4x7jM23N01F41o2G/LwimRJe582+Yl2B9mh7xWyvePYDvfHlJV/JkhXEfqr+li+CQkC5g9zg7h4nA== 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 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.