Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp6502976pxu; Thu, 24 Dec 2020 04:15:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJwUwe3j04+rK3aTHMWYt9YYDrurHUl22MvAfhCBGPkW0VfQaT+NcanKGTu/W32UQ9lNYa74 X-Received: by 2002:a05:6402:1045:: with SMTP id e5mr28721443edu.40.1608812138465; Thu, 24 Dec 2020 04:15:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608812138; cv=none; d=google.com; s=arc-20160816; b=oH+3tR46qySgHWVeftArvapX+YvEj7DmhJzm244aoUMGS41TWBJVC7Jb44phS6thdr pvBkSdLOE0O2li6aDwwWr8c0S8+Djee7AyoRRRXoZQiEs+ySSl814ZMMIfvLvvnGil97 /7F0xdKG77yWySohH0HR3bU+ME0faBCHZ+VZIyXbdeyMp4ypiU62GlvFqvPrmOVKe/c7 /uZHFHtrtZHSV9TsYHipyxcfJoR0cDkgPLaFmq69HXB/b7stkBfBcycsWJwmCRbjRplH s4FxnZTsOAC/fYRKYzi309mPQQyQ9FMs8CBVZcErXE8GsH6zzoYhBzUrWWYFX4MhPsTD tQvg== 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=ifO2Z41UF/ZdXjDCo5wL8aXgOUw3K83yCcmilFeONd8=; b=Wpm1x8z0XcbNslqc5mk3iLqrKmWcLLo+isaWO7As8rgeko1xtK6AwUnfXm8NfNOqQH j9qIBTfWUb8WgT7XDdNBYQHETg/9t+b+J2/N7QGCBe5On2wUwIGr64ONAxxJXQTUk1l9 zaUylukon0gZ57I6/5LTL4Mb66fpbP7o2CFqXutUpL5vMoxcaVrmco0a8HYLfbeCOnNS AfkTHHnybWtUVEiSuA0JQ/XLa9yBELkOixnx6xH5+F6x6hQam/aqRSX5El8GDPHQ4Wmd QOAcA2XZhb+eLs2S2M6fj1nmaMH9FwljfL7IWhkyD7LRaWDM1NUTR9RuTh9OtiP8hPNk 9waQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=J4sz+5Uc; 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 dd19si14879096edb.502.2020.12.24.04.15.15; Thu, 24 Dec 2020 04:15:38 -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=J4sz+5Uc; 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 S1728355AbgLXMOi (ORCPT + 99 others); Thu, 24 Dec 2020 07:14:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727114AbgLXMOi (ORCPT ); Thu, 24 Dec 2020 07:14:38 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68C48C06179C; Thu, 24 Dec 2020 04:13:57 -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=ifO2Z41UF/ZdXjDCo5wL8aXgOUw3K83yCcmilFeONd8=; b=J4sz+5UcNIflCLTVeCfClavL70 sYTuvVbC1vbi1wUVFepnDPTYAaMqiXlJ4lKmAANmUAs1LS1KS3+oOWf/MrIJZ93DMAgLmKBkczCNX 9UZ5afuYzKyUMEgCD0dGsVULGDstM4r5nrh1VUR5+VghVXUGLavMRr3xSes9DAVmkRB6Cc42dCAzt aki6C2pQiaM2s0G0rBdUndm+vm/kRMnDxZePRsQbUv2Mitkoqb51C4VWEf2xycHkuviUUlzq+oQqT 7sh9/4EGb3T138Pn1PZ0Swy91ONGqLCoiuVZrZcugMwflgPAy7Qqlvh0ni9NT3PgsnnS/UnFu3UgZ Dt2M8D3w==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1ksPVA-0002V2-SM; Thu, 24 Dec 2020 12:13:52 +0000 Date: Thu, 24 Dec 2020 12:13:52 +0000 From: Matthew Wilcox To: Amir Goldstein Cc: Vivek Goyal , Sargun Dhillon , linux-fsdevel , linux-kernel , overlayfs , Jeff Layton , Miklos Szeredi , Jan Kara , NeilBrown , Al Viro , Christoph Hellwig , Chengguang Xu Subject: Re: [PATCH 3/3] overlayfs: Report writeback errors on upper Message-ID: <20201224121352.GT874@casper.infradead.org> References: <20201221195055.35295-1-vgoyal@redhat.com> <20201221195055.35295-4-vgoyal@redhat.com> <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 24, 2020 at 11:32:55AM +0200, Amir Goldstein wrote: > In current master, syncfs() on any file by any container user will > result in full syncfs() of the upperfs, which is very bad for container > isolation. This has been partly fixed by Chengguang Xu [1] and I expect > his work will be merged soon. Overlayfs still does not do the writeback > and syncfs() in overlay still waits for all upper fs writeback to complete, > but at least syncfs() in overlay only kicks writeback for upper fs files > dirtied by this overlay. > > [1] https://lore.kernel.org/linux-unionfs/CAJfpegsbb4iTxW8ZyuRFVNc63zg7Ku7vzpSNuzHASYZH-d5wWA@mail.gmail.com/ > > Sharing the same SEEN flag among thousands of containers is also > far from ideal, because effectively this means that any given workload > in any single container has very little chance of observing the SEEN flag. Perhaps you misunderstand how errseq works. If each container samples the errseq at startup, then they will all see any error which occurs during their lifespan (and possibly an error which occurred before they started up). > To this end, I do agree with Matthew that overlayfs should sample errseq > and the best patchset to implement it so far IMO is Jeff's patchset [2]. > This patch set was written to cater only "volatile" overlayfs mount, but > there is no reason not to use the same mechanism for regular overlay > mount. The only difference being that "volatile" overlay only checks for > error since mount on syncfs() (because "volatile" overlay does NOT > syncfs upper fs) and regular overlay checks and advances the overlay's > errseq sample on syncfs (and does syncfs upper fs). > > Matthew, I hope that my explanation of the use case and Jeff's answer > is sufficient to understand why the split of the SEEN flag is needed. > > [2] https://lore.kernel.org/linux-unionfs/20201213132713.66864-1-jlayton@kernel.org/ No, it still feels weird and wrong.