Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9463032pxu; Mon, 28 Dec 2020 17:27:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJxJi1JpwjwWI5XKb89UsREUvRBBW3PHolveSQy3GflyFOgiLOwueVb562dEcJIjawygqc/r X-Received: by 2002:aa7:d485:: with SMTP id b5mr43158232edr.214.1609205222285; Mon, 28 Dec 2020 17:27:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609205222; cv=none; d=google.com; s=arc-20160816; b=pTFMVlcqYAAwlN7UCr/3yyCh31OjTwHUN4lE8WHcG4Zp/uoo8I06kSA1Fr9peFGiKI LjWJcsgNfgubymYa3LtHGDkD+VUvADmOaAXbC1+tTIS4RH86l0EKu3gkQ9Fn5fRpjnXB Sf/TGnIuHsQALbQgAB2ieriV0rxY9UvQQgQOQAo5fnQvM8Zwt1tDAomLtp/HaT4jOgj6 f0euuacRe6TcL54tgebIUiDiGcQUozEGfiPtKwkPuNd5Y42U63V9Bg56ssrzAunUye3Y zD8RMzhre2qN9aoMuGfb63dRT74LdRe1WP0Di1XsghaU657N9QWZcPboIYuXSePNgS4x JRiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=/nOHULSFy60FT+2em7J7OYQMxQyHIY7jUtPb874hlfY=; b=XKQw/L91/RAQNUaGSfS8uObQzpuQ1uMa4RPGyLqpxbkRtyGzzB+Pv8JJblwQthvtFx GD6K5af5TZJW8IydhJQ70G3nDGV7Y2xHPD+GPkGZxjGxh7MYWSawPzDm2qk9DgeCyGo9 X+WGsRZevjkUeJru3mgA8GnL33tuHXe1Va+yApN43/6+J9x0QmmlbnvdIAbznqKo63i1 gMNZFKxJSgaHHPes5pbiCFx8BxTHDj4qzhHwi7GPfjpO6W3zoBZT+1tGAZxGnFTr0QQD J/nD29J3OiJhp5odeMKwiIkp0Dm3iMfzWLlgsDYG8dHrRU2/EMijSBiYHHY5YbojrWBk Nsyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sargun.me header.s=google header.b=X44sptDy; 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 do19si19316371ejc.670.2020.12.28.17.26.40; Mon, 28 Dec 2020 17:27:02 -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=@sargun.me header.s=google header.b=X44sptDy; 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 S1728494AbgL1T0g (ORCPT + 99 others); Mon, 28 Dec 2020 14:26:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728212AbgL1T0f (ORCPT ); Mon, 28 Dec 2020 14:26:35 -0500 Received: from mail-io1-xd34.google.com (mail-io1-xd34.google.com [IPv6:2607:f8b0:4864:20::d34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66ADDC061796 for ; Mon, 28 Dec 2020 11:25:55 -0800 (PST) Received: by mail-io1-xd34.google.com with SMTP id y5so10262797iow.5 for ; Mon, 28 Dec 2020 11:25:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sargun.me; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=/nOHULSFy60FT+2em7J7OYQMxQyHIY7jUtPb874hlfY=; b=X44sptDyBjDo7Fmfh69zd2cXOO3bKdRIJm8eh0l8IIcytCkAv80h2Gz0xw56kaQVbG 3qB4LlWGBBDdk2vj+xhlj/qjSLyNi6ZZsWrh9bp1+qXoh5vYWZYmtrSYe01KB9X64N6g VM63QPWOHcxIfrnutXwU4sUo1dNjYZYjlCuI4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=/nOHULSFy60FT+2em7J7OYQMxQyHIY7jUtPb874hlfY=; b=a9zGNBfMfuNQDwllUJ4uIG216N1YWR+dgt3pKY9UV5yylkv09L8jp+1q7UIdfmJJVQ 4T57agjhyXD44uDYyi/MN7MI0jCJxbQWcxHuEWAB0WFuW14slQk2fIwpgCxe75Bpst1T J42Uh3lTzulMfYt89rj9VsdgNnsSVltVTdbQ33MO2Vo1JGjj+UEyNvsRgm0gF8tj2M70 XhABxAokv+aXwpRLi8H4HYtDNmQn1OUuRcXDtLJy8sHfUMF6c2OQ4jMss+uooVGzM3jZ 5c9xlx8NNDW8JxrxvxwioQltRY7T18dUgzOKM4HPMI6EHMviCU408ScP4IssWsvj+r3z QdGw== X-Gm-Message-State: AOAM531FOCYt41qOtBsIlowTBuCIwiqmZepnYJW//CmM6MwAL9YkpgSa H5PLYwFaqn9D9l1w/SWmXo5oLlUujsO+NildzYGAMQ== X-Received: by 2002:a6b:e704:: with SMTP id b4mr14476477ioh.114.1609183554526; Mon, 28 Dec 2020 11:25:54 -0800 (PST) MIME-Version: 1.0 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> <20201228155618.GA6211@casper.infradead.org> <5bc11eb2e02893e7976f89a888221c902c11a2b4.camel@kernel.org> In-Reply-To: <5bc11eb2e02893e7976f89a888221c902c11a2b4.camel@kernel.org> From: Sargun Dhillon Date: Mon, 28 Dec 2020 11:25:18 -0800 Message-ID: Subject: Re: [PATCH 3/3] overlayfs: Report writeback errors on upper To: Jeff Layton Cc: Matthew Wilcox , Amir Goldstein , Vivek Goyal , linux-fsdevel , linux-kernel , overlayfs , Miklos Szeredi , Jan Kara , NeilBrown , Al Viro , Christoph Hellwig , Chengguang Xu Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 28, 2020 at 9:26 AM Jeff Layton wrote: > > On Mon, 2020-12-28 at 15:56 +0000, Matthew Wilcox wrote: > > 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. > > > > In principle, you can lose errors this way (which was the justification > for making errseq_sample return 0 when there are unseen errors). E.g., > if you close fd1 instead of doing a syncfs on it, that error will be > lost forever. > > As to whether that's OK, it's hard to say. It is a deviation from how > this works in a non-containerized situation, and I'd argue that it's > less than ideal. You may or may not see the error on fd2, but it's > dependent on events that take place outside the container and that > aren't observable from within it. That effectively makes the results > non-deterministic, which is usually a bad thing in computing... > > -- > Jeff Layton > I agree that predictable behaviour outweighs any benefit of complexity cutting we might do here.