Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp6033939pxu; Wed, 23 Dec 2020 11:32:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJx1wc6BPh/Cya7ZCTjKrL67Wsg2pmeH1DImYSlPo72tb5Kc5tTZ0G59TydgXAslLX8MyfY4 X-Received: by 2002:aa7:cd44:: with SMTP id v4mr25928228edw.156.1608751935333; Wed, 23 Dec 2020 11:32:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608751935; cv=none; d=google.com; s=arc-20160816; b=Emue4eeHGhRnBnDD6NWbb+46CIj27nXv5LCp7M4t8KVZQJMHbzNbmNaPNuiXRc95Ds o37+3ASXLYzwJA3rwMoGyQxgpaZFIFZ3rOaC7KEl4KEaWrigzGR62EB/1aHoylM4jH5F bn/5Ab6Gqrgns4DC+F0LkkaKAapoVsGCRKUX6j0KPApp8booWEx/OsGzwkq3B3jhmO57 N89U/VnN0U4PJomz5Ov3ZCHyR9/JB9oFi9yFORV0QhrPVyt6fKnBNnxNChCYmTQJ6DYG yui1qPJOB0wDq0HZD0eyRT5u1wAwBi5Dmn6VJPg+AuXe5qi97lgkoJbno70kt2EI6PwF Otdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=GO51UVUTNvBhCJQD69obTiRmEahl2WX/DtgMyfCh1aI=; b=W2WbDE4+vNnO6lrVVLLLpCRgEgXRnVtzkuxKW9QI7UR160qD8MQidclU69fWk3qH+8 KnYlSdlWuXyoHA7wX1id2+1N5cH2MEUlwwN5n3nIGXtukpKpwiYxw5CAeMthjeBzp8i4 pZanQRrvYxO0gROsfxWMtGSvySiKT2XuBXE4Mpl3NpZWIw4cbjAnvRAqygCxx+rr9j5B XiDQA1YwTUgzmAJZSCjbuh/bnlNA+aliTYIMbLmlwaXdlMsbdMit9pB+JUWvbMIpFKhv 7pPH6MO32UDfILO7cDS9HLpAxiHj/S/scf1CJHomO5b6iFzPC/CiMri0+wAS/ebVm99/ /G9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sargun.me header.s=google header.b=umJvLbga; 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 t21si17716014edi.2.2020.12.23.11.31.52; Wed, 23 Dec 2020 11:32:15 -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=umJvLbga; 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 S1728355AbgLWTa3 (ORCPT + 99 others); Wed, 23 Dec 2020 14:30:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726384AbgLWTa2 (ORCPT ); Wed, 23 Dec 2020 14:30:28 -0500 Received: from mail-il1-x129.google.com (mail-il1-x129.google.com [IPv6:2607:f8b0:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7AC6C0617A6 for ; Wed, 23 Dec 2020 11:29:43 -0800 (PST) Received: by mail-il1-x129.google.com with SMTP id v3so123188ilo.5 for ; Wed, 23 Dec 2020 11:29:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sargun.me; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=GO51UVUTNvBhCJQD69obTiRmEahl2WX/DtgMyfCh1aI=; b=umJvLbgabVKE8NNhribeB3Mj6CL5aAY9F2WgopT7biHDRcoOldyYTms3ycziT26qQg P/kXz1hRLNT/c/2MSX9QidYbgghCvG1gzH9BMOUcaNgrU+AUO2svFTveIGmWm/KhLYeG s7Y0jLEyONdRTDgzkLpKdIWWRoJOBg1zkOagU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=GO51UVUTNvBhCJQD69obTiRmEahl2WX/DtgMyfCh1aI=; b=Rm/rrZxuyPAs+cPxd47xhACuliHvPU8gjmRfNAGi6xheU0KD+ZuqUMLdscFwKbB1az KP54rfW72Npnhyo+Z2JN2lFF/pOuxFwg0wl6QgqjSDMvJF1aieKKfhw5EBgm7KRAwAUm iBcm36oZFL6wPdj07+RrIM2p52J0C46Se1aNzPYJZskMqrbi5U/CVm1s/ZMRziKh4obN nQWtT5US4G/hv8v/hd8p5fuYUJXFgvMUVEwrXg+vuLRoJLUidgSKZfuuOmxIlk03b0Os eK2U9CXU58cG416RI62Y9/b+OW0p+MuURmIzgtoPaniNemMb0tJbtYw/wqg9a7YP2SML 6GiQ== X-Gm-Message-State: AOAM533RWh4fHuXSqaGPf4emj3HWt7nmo5l2xmmlmYVXMfknha9vyTWh VuhNwNbpHn+bllcSODHAQc5tNg== X-Received: by 2002:a92:bd04:: with SMTP id c4mr27471004ile.158.1608751782751; Wed, 23 Dec 2020 11:29:42 -0800 (PST) Received: from ircssh-2.c.rugged-nimbus-611.internal (80.60.198.104.bc.googleusercontent.com. [104.198.60.80]) by smtp.gmail.com with ESMTPSA id n77sm26473525iod.48.2020.12.23.11.29.42 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 23 Dec 2020 11:29:42 -0800 (PST) Date: Wed, 23 Dec 2020 19:29:41 +0000 From: Sargun Dhillon To: Matthew Wilcox Cc: Vivek Goyal , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-unionfs@vger.kernel.org, jlayton@kernel.org, amir73il@gmail.com, miklos@szeredi.hu, jack@suse.cz, neilb@suse.com, viro@zeniv.linux.org.uk, hch@lst.de Subject: Re: [PATCH 3/3] overlayfs: Report writeback errors on upper Message-ID: <20201223192940.GA11012@ircssh-2.c.rugged-nimbus-611.internal> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201223185044.GQ874@casper.infradead.org> User-Agent: Mutt/1.9.4 (2018-02-28) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 23, 2020 at 06:50:44PM +0000, Matthew Wilcox wrote: > On Wed, Dec 23, 2020 at 06:20:27PM +0000, Sargun Dhillon wrote: > > I fail to see why this is neccessary if you incorporate error reporting into the > > sync_fs callback. Why is this separate from that callback? If you pickup Jeff's > > patch that adds the 2nd flag to errseq for "observed", you should be able to > > stash the first errseq seen in the ovl_fs struct, and do the check-and-return > > in there instead instead of adding this new infrastructure. > > You still haven't explained why you want to add the "observed" flag. In the overlayfs model, many users may be using the same filesystem (super block) for their upperdir. Let's say you have something like this: /workdir [Mounted FS] /workdir/upperdir1 [overlayfs upperdir] /workdir/upperdir2 [overlayfs upperdir] /workdir/userscratchspace The user needs to be able to do something like: sync -f ${overlayfs1}/file which in turn will call sync on the the underlying filesystem (the one mounted on /workdir), and can check if the errseq has changed since the overlayfs was mounted, and use that to return an error to the user. If we do not advance the errseq on the upperdir to "mark it as seen", that means future errors will not be reported if the user calls sync -f ${overlayfs1}/file, because errseq will not increment the value if the seen bit is unset. On the other hand, if we mark it as seen, then if the user calls sync on /workdir/userscratchspace/file, they wont see the error since we just set the SEEN flag. You need a new flag (observed) to differentiate between "Seen and reported to user" versus "seen by a second-order system, so should now increment". One alternative is to always increment the errseq error counter, but I've gotta imagine there's a reason that wasn't done in the first place.