Received: by 10.192.165.148 with SMTP id m20csp3904437imm; Mon, 23 Apr 2018 14:45:08 -0700 (PDT) X-Google-Smtp-Source: AIpwx48TvzrmWH5F1oLXFDInGIaoKCcLKN4VYuV3S7BhYY8iQCiIC0W7xizYw2oeDUFHAT+fSeHm X-Received: by 10.98.4.133 with SMTP id 127mr21428575pfe.26.1524519908415; Mon, 23 Apr 2018 14:45:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524519908; cv=none; d=google.com; s=arc-20160816; b=fRPojWvEMzCroqOlrDwtrEd3n6/Msn7ei9KNYuWQ3h8BvUp0yTQmJgriYrYyPp2OyH gPLO6ZM7F5Iqr7hmWQiH9fVW20WfkxU1F36s4TJWOT4e0EUL7O8nKcb1cvSXJ/mYlO85 w7xMXi9MmyAiMmXupHVD2xCJGFrniYKbR6ZpQiKm3Cw2u9msZWncsKcN/5Z7fPaEdZtN oAHjCC1Q366YopulXFHWATAL+kutTAQdv73Jg11L+AL58kr27Hv2jH0BaKrpKOW96It+ 54THNQqHx7Xhl27tNDcvFkX9MIiCMxDh+eMYw96IncQN7K08AR+CXwPGz9DKuNTKRl15 1XNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=HX+Bv53ri8ssxQEYx1c3cqI4z6p5dquVMH1hv5C20lM=; b=u25Wvqwa+QIXZkjqCfqlA4BaH370N3Zh20+H5UfDi6wHzVXF2p9/xmcKRh4b+rikMS tf9SXBF61l8JfNWSINBdpms00lGYF5mV3Ia25+rAE7q/Le0Q4wQkOev4FoJIlbZH7HId Gq0Q5/FW0nqxSJ9YK6IaY8nQYPSj/fbt1b754voL9KvjQmSBhskX8POkJMctDTtyGQw4 nQCymk36axSgf1gORLDUS29bmQVT5+w3GxwQpCtfyBNnllDPp92LSjZi0ZR/4i3XwFRu rbG3y7NHlNh1MTlenXL6Mtm8b2CoVUf/wOub6KG2j/2edI7jRqGM58N7lGAfZYFqi9AP Wgzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=ev3E0Aqq; 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 u71si5615551pgb.332.2018.04.23.14.44.53; Mon, 23 Apr 2018 14:45:08 -0700 (PDT) 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=ev3E0Aqq; 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 S932548AbeDWVnu (ORCPT + 99 others); Mon, 23 Apr 2018 17:43:50 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:55766 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932291AbeDWVnt (ORCPT ); Mon, 23 Apr 2018 17:43:49 -0400 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:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=HX+Bv53ri8ssxQEYx1c3cqI4z6p5dquVMH1hv5C20lM=; b=ev3E0Aqq/0pyoRWFzJ7md7SYE sjiQzTDMHmM8gRadJ2P/T1eVXASU71SV3YKhSlBX4tXmO29b7KgH9dZUNpAwmL8ihNDQTKh6z7ezf V1bKT1fH48MxxWbYDIzVZUtwMXne5WqruZTM9PwNnyXyAigieSQmoa71E4J7dZPRryWPn3A9F8N9/ 4m+kvq3dNJnegYwDyrnwmmNafUv2sPMSSiEzGUzXr3XC/IkJh0yecTWvZS6kbua5QPGAX4uvaNUUk 2eR8wTwogC5Lb0CPmDJxiUwAgzdO++e60JTz4NgFYG4ncCE7O2oQJS3VDxBcw8+76wIM/ng63avix TDCrYsQVg==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1fAjFU-0004of-OP; Mon, 23 Apr 2018 21:43:48 +0000 Date: Mon, 23 Apr 2018 14:43:48 -0700 From: Matthew Wilcox To: Andres Freund Cc: linux-fsdevel@vger.kernel.org, Jeff Layton , linux-kernel@vger.kernel.org Subject: Re: [PATCH] Always report a writeback error once Message-ID: <20180423214348.GH13383@bombadil.infradead.org> References: <20180423204208.GG13383@bombadil.infradead.org> <20180423205730.34wvykqhefbkrtfw@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180423205730.34wvykqhefbkrtfw@alap3.anarazel.de> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 23, 2018 at 01:57:30PM -0700, Andres Freund wrote: > On 2018-04-23 13:42:08 -0700, Matthew Wilcox wrote: > > @@ -119,19 +119,11 @@ EXPORT_SYMBOL(errseq_set); > > errseq_t errseq_sample(errseq_t *eseq) > > { > > There's a comment above this: > * > * This function allows callers to sample an errseq_t value, marking it as > * "seen" if required. Oh, good catch. I'll fix that. Thanks! > I've never really looked at this code in any depth before, but won't > this potentially lead to the same error being reported on multiple FDs? > Imagine two fds (potentially in different processes) getting the 0 > returned by errseq_sample() because it's not ERRSEQ_SEEN. Afaict > file_check_and_advance_wb_err() will return an error that's always > unlike 0 in that case, and thus the error will returned on both fds? > > I'm personally perfectly fine with that, but it's not necessarily what's > described as desired in your email?. That's what I was trying to say with this paragraph: > > This patch restores that behaviour by reporting errors to file descriptors > > which are opened after the error occurred, but before it was reported > > to any file descriptor. Maybe it was a little unclear? I'd appreciate a suggestion on making it clearer. I think this behaviour is perfectly justifiable. Writeback errors occur asynchronously to open. Userspace can't tell the difference between: kernel: writeback p1: open p2: open p1: fsync p2: fsync and p1: open p2: open kernel: writeback p1: fsync p2: fsync Since both p1 and p2 would get the writeback error in the second case, they can both get the writeback error in the first place. p2 can't rely on this, after all we could have the sequence: p1: open p1: fsync p2: open p2: fsync and p2 will not see the error, but it wouldn't have seen the error before the errseq_t infrastructure went in. And maybe p1 handled the error three weeks ago; we don't want p2 to see the error.