Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9156555pxu; Mon, 28 Dec 2020 08:01:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJyTTMC6RYVqExIrppQCTAYEYSmdnEtIrqh+/CCB5TxulvrHqIKoRO+zebfWQHx3tQyySoBZ X-Received: by 2002:a50:998f:: with SMTP id m15mr27902012edb.342.1609171305456; Mon, 28 Dec 2020 08:01:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609171305; cv=none; d=google.com; s=arc-20160816; b=0vlxgbVU11qlYvx4xqzDMcLgyfx5VRyURi6bAm5uFrHfpqYjoW15qyHXT0Aka5hqOP hwjbOWq7BcZFX/Hq/M04S2BRIDZSRWzjHxQfcU4b7VbpDKdT9rF21KUheYRh01Ce4wks 76f3FiAkHPmXzpqG9ToAl+Y+Sbw9tBAF6VmekF9ijeXtquuqP9gHZyn2ssZaUq8OCoFC pgo68ifeG/RX7F/jQIk5ot+47XMBjySXSwiCubPeYLOHfcgOb45+vd56J+bvku0Xplwu AHHhQPzXGHxSLpAaRqNVzeXQrLyXONQzALTk0MObI2nYAeYGw2wP9CUeLQPiqXlTFkui aRmw== 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=FGpC//fOURR6xbsUxytCh0bux+vv2dcWmfFgyJiqKQ8=; b=gq+0mpe8PUeq71wgdP5hruanNhRZjAPgvD7EYIBG8M45zuxr2nPl0xuI6GhKh/JvEC I/zvb3crXJt8tTcIqxjSpQd1S3GbmGaYV2xQxyMUkBIezE6na5t/7mMXX0owZUoOXY3D ke7OG6p5pyrk2nEncpfjjckP8Dd0Qzv+AEvDb7ZGTzI8OCQGhqnuXAbpFATL4rLVqJoW EnnKmj1LUheFruOJcQ4/QObuX9VSz/bTOAqeAzYSqemQ4JYI5RQHgZSP7s1T+0427RdJ jZ6q6O73Ka4QfHr12fvR5j2WHfmDorQv0K+cnskdA1d/yc86/NzorWi4R1mbPWKsjkBd uOOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=QL7PQTdZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gb13si19304515ejc.320.2020.12.28.08.01.22; Mon, 28 Dec 2020 08:01:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=QL7PQTdZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393334AbgL1P6X (ORCPT + 99 others); Mon, 28 Dec 2020 10:58:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2393323AbgL1P6W (ORCPT ); Mon, 28 Dec 2020 10:58:22 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA6DCC06179B; Mon, 28 Dec 2020 07:57: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=FGpC//fOURR6xbsUxytCh0bux+vv2dcWmfFgyJiqKQ8=; b=QL7PQTdZ3w2Zu/c+bVynnSoH+C 9k8q+5hWkvSV2XCDBDEb3+dM7z4qTbL+xORHbkS8ej+Yg8tG7uZoC/DCyA9C+L6FASNWkbeRdbbFQ YFGYgZ2z6H+46KVo9UfsINGlMF7Y3YpJh5Q8t8zYoa90EWKbtDoertRpKqTB57EqPurQUlyx6h7iA hqqpvYVI4JFBcpvKyah3mC2VVrzwIqwLVknTtLdf7ikp/lbsoo/b9L4gBCdR5S+bneE4iENY3FeTz xH7GTvcYHXLL+d+jKEx09XV1KsQdy1ZV0/GFHA5jnmDmiOsv4TT3B3hhWSIrZoL11ghOhRaSou5A6 OgXTq9DQ==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1ktusc-0001eS-6o; Mon, 28 Dec 2020 15:56:36 +0000 Date: Mon, 28 Dec 2020 15:56:18 +0000 From: Matthew Wilcox To: Jeff Layton Cc: Amir Goldstein , Sargun Dhillon , Vivek Goyal , linux-fsdevel , linux-kernel , overlayfs , Miklos Szeredi , Jan Kara , NeilBrown , Al Viro , Christoph Hellwig , Chengguang Xu Subject: Re: [PATCH 3/3] overlayfs: Report writeback errors on upper Message-ID: <20201228155618.GA6211@casper.infradead.org> References: <20201223182026.GA9935@ircssh-2.c.rugged-nimbus-611.internal> <20201223185044.GQ874@casper.infradead.org> <20201223192940.GA11012@ircssh-2.c.rugged-nimbus-611.internal> <20201223200746.GR874@casper.infradead.org> <20201223202140.GB11012@ircssh-2.c.rugged-nimbus-611.internal> <20201223204428.GS874@casper.infradead.org> <20201224121352.GT874@casper.infradead.org> <1334bba9cefa81f80005f8416680afb29044379c.camel@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1334bba9cefa81f80005f8416680afb29044379c.camel@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 28, 2020 at 08:25:50AM -0500, Jeff Layton wrote: > To be clear, the main thing you'll lose with the method above is the > ability to see an unseen error on a newly opened fd, if there was an > overlayfs mount using the same upper sb before your open occurred. > > IOW, consider two overlayfs mounts using the same upper layer sb: > > ovlfs1 ovlfs2 > ---------------------------------------------------------------------- > mount > open fd1 > write to fd1 > > mount (upper errseq_t SEEN flag marked) > open fd2 > syncfs(fd2) > syncfs(fd1) > > > On a "normal" (non-overlay) fs, you'd get an error back on both syncfs > calls. The first one has a sample from before the error occurred, and > the second one has a sample of 0, due to the fact that the error was > unseen at open time. > > On overlayfs, with the intervening mount of ovlfs2, syncfs(fd1) will > return an error and syncfs(fd2) will not. If we split the SEEN flag into > two, then we can ensure that they both still get an error in this > situation. But do we need to? If the inode has been evicted we also lose the errno. The guarantee we provide is that a fd that was open before the error occurred will see the error. An fd that's opened after the error occurred may or may not see the error.