Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp2758251ybh; Mon, 9 Mar 2020 12:23:14 -0700 (PDT) X-Google-Smtp-Source: ADFU+vux/vEwpLJsZFVD1H6UmLDiWhXL/wRnAhSAuDkyvbcXsLbwJRrieanXQdrE6qwlXqWsjevY X-Received: by 2002:a9d:178:: with SMTP id 111mr14759329otu.238.1583781794672; Mon, 09 Mar 2020 12:23:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583781794; cv=none; d=google.com; s=arc-20160816; b=mfyU6lmutoTmaXjOq71qAgygVOIvclR7JlTCXhPjC6A2krJ4zfRzPPLBJju+AhFCZh P3sTJOisHkEvOy51yeNFDHy9Iw0h+grTurYecPsVuAlvnN8pZoHDd1dlqBCb4zi0Sn6x DR4iWUWLYo0bR/UjF9QU6x7oUfi2S8NuNYLgTHRhsg9d6X6Nh58ZldQTcYf4hGnSSd+L dAJ+sBMKH/wTtaLzhdMsyAZ+9tzWyNVLo+Z5d1NUQ0AHUoiZib9ZjEZ8rdhjsxk2xniy C8UM6VvXud1TIiG+pGM+qeJ6DeALQnldjGRs7D5V9zaQOslQ54/3sJcHeOzLIcdlnMay U+9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:dkim-signature; bh=9OPUApP7XHwBJ2ua/845zHXN+BxCiMndYLVmUljdPfs=; b=EQHR21jnVNfLf8lQYcE5Eqmjb4nc0yO5pEHxSmruOFMrPUEZoQ8D2E/3tF+bQZ/4ot GJveIYLaTQzwexvE9iZfq0tid861e8NaFFDBXzp45z+0iJh3koerhddf9uTJREYEaTAU 3vaKch2+halwJRPHcFq10l0k2iXd2npY08kwl8ezJbvfByZgzzFV1cc5RD/JyYjVeT3q +9ysWf90bAEWVHpMPt76BTwxLirjxrr+SoGDk9qA7bS1kWuBtwddr/JZFW6Coz1zabA3 ktdxyD3Ud2pJbvU06OZ59slXmpDCSfj3OTlVHuVU1OabaIRSRKmyqNq5GrxUo3iX/DQO WB1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@anarazel.de header.s=fm1 header.b=Zx+aJhCQ; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=Jz9WWT0O; 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 j9si3854715oiw.133.2020.03.09.12.23.02; Mon, 09 Mar 2020 12:23:14 -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=pass header.i=@anarazel.de header.s=fm1 header.b=Zx+aJhCQ; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=Jz9WWT0O; 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 S1726333AbgCITWq (ORCPT + 99 others); Mon, 9 Mar 2020 15:22:46 -0400 Received: from new2-smtp.messagingengine.com ([66.111.4.224]:52095 "EHLO new2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726118AbgCITWq (ORCPT ); Mon, 9 Mar 2020 15:22:46 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.nyi.internal (Postfix) with ESMTP id 0273F2165; Mon, 9 Mar 2020 15:22:43 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Mon, 09 Mar 2020 15:22:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=9OPUApP7XHwBJ2ua/845zHXN+Bx CiMndYLVmUljdPfs=; b=Zx+aJhCQuuW9zL3vV9mkX5vIdNdmN8/IWDffz8jj8Gb 2VqO7mxto+/Dg70LiN2yzj5fiYHNKAZzx3yPelxgwUoQ+is2cdcJE5cIvJzPpLwP 1xPCpmX1WtFmzCKNubm6b5P2EF7CkKxJXHsEs6ybNxRzQCPJzbqZOZSd96rAWA/s 7nO1xn8GN/rhw5+44q9xquYivc/LsB5DNy1Sr7wODuT8vz1B9CEd7RzJQ6+yCPws Q4BQsksfc1slCjyk7DZeBxKlsDmu+IkwTWvjrJ+31T+ybHClZpCgA7ZxHxIt60ze 0rjBlnXvVbJq19rll/30PhxY+fbw911ReY76p4D4+Zg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=9OPUAp P7XHwBJ2ua/845zHXN+BxCiMndYLVmUljdPfs=; b=Jz9WWT0OhfWbV49D+wIuxm 3sJ9Kel6t8sFJrmVyv19hsEiQzOp4evJzLdEZVY55UsNPi/dB2hyJt29LHCe6dgR e9kD+L7Mfl3qIo5ngts0zeS4esAEGVEiQFlDYmvxdL6dProHeRHBKtaE/tUyf/00 8oGdCWK0UbGe2iA2wkAaSoN7+HqKLQfmK+nd513rMwVTTJKW1TPnr406mI6fJgBD SO+dv4s23dzemFtebeyTZ4TOCeYWUAeWda6lC3gkrRn/vRPfMhiXV1tyvQYLY7M6 H1SvTye3XXhWvy0SBwMOBi4R8fHduIcKySwDxPapJ+gRfXM3EFhrm2VGK8Ka2Q+A == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedruddukedguddvgecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvuffkfhggtggujgesthdtredttddtvdenucfhrhhomheptehnughr vghsucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghrrgiivghlrdguvgeqnecukfhppe eijedrudeitddrvddujedrvdehtdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgr mhepmhgrihhlfhhrohhmpegrnhgurhgvshesrghnrghrrgiivghlrdguvg X-ME-Proxy: Received: from intern.anarazel.de (c-67-160-217-250.hsd1.ca.comcast.net [67.160.217.250]) by mail.messagingengine.com (Postfix) with ESMTPA id 0771F328005A; Mon, 9 Mar 2020 15:22:42 -0400 (EDT) Date: Mon, 9 Mar 2020 12:22:40 -0700 From: Andres Freund To: Jeff Layton Cc: David Howells , torvalds@linux-foundation.org, viro@zeniv.linux.org.uk, Theodore Ts'o , Stefan Metzmacher , Andreas Dilger , linux-ext4@vger.kernel.org, Aleksa Sarai , Trond Myklebust , Anna Schumaker , linux-nfs@vger.kernel.org, linux-api@vger.kernel.org, raven@themaw.net, mszeredi@redhat.com, christian@brauner.io, jannh@google.com, darrick.wong@oracle.com, kzak@redhat.com, linux-fsdevel@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 00/14] VFS: Filesystem information [ver #18] Message-ID: <20200309192240.nqf5bxylptw7mdm3@alap3.anarazel.de> References: <158376244589.344135.12925590041630631412.stgit@warthog.procyon.org.uk> <2d31e2658e5f6651dc7d9908c4c12b6ba461fc88.camel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2d31e2658e5f6651dc7d9908c4c12b6ba461fc88.camel@redhat.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 2020-03-09 13:50:59 -0400, Jeff Layton wrote: > The PostgreSQL devs asked a while back for some way to tell whether > there have been any writeback errors on a superblock w/o having to do > any sort of flush -- just "have there been any so far". Indeed. > I sent a patch a few weeks ago to make syncfs() return errors when there > have been writeback errors on the superblock. It's not merged yet, but > once we have something like that in place, we could expose info from the > errseq_t to userland using this interface. I'm still a bit worried about the details of errseq_t being exposed to userland. Partially because it seems to restrict further evolution of errseq_t, and partially because it will likely up with userland trying to understand it (it's e.g. just too attractive to report a count of errors etc). Is there a reason to not instead report a 64bit counter instead of the cookie? In contrast to the struct file case we'd only have the space overhead once per superblock, rather than once per #files * #fd. And it seems that the maintenance of that counter could be done without widespread changes, e.g. instead/in addition to your change: > diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h > index ccb14b6a16b5..897439475315 100644 > --- a/include/linux/pagemap.h > +++ b/include/linux/pagemap.h > @@ -51,7 +51,10 @@ static inline void mapping_set_error(struct address_space *mapping, int error) > return; > > /* Record in wb_err for checkers using errseq_t based tracking */ > - filemap_set_wb_err(mapping, error); > + __filemap_set_wb_err(mapping, error); > + > + /* Record it in superblock */ > + errseq_set(&mapping->host->i_sb->s_wb_err, error); > > /* Record it in flags for now, for legacy callers */ > if (error == -ENOSPC) Btw, seems like mapping_set_error() should have a non-inline cold path? Greetings, Andres Freund