Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp45432ybh; Mon, 9 Mar 2020 15:51:15 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsnNHrVzwY5R20JfzwIbKYZ2AmZYgfr5PFTSqnVW/ZjI4ryWQk6lsXzW/EoEsR3OG8PLENS X-Received: by 2002:a9d:264:: with SMTP id 91mr15003787otb.216.1583794275836; Mon, 09 Mar 2020 15:51:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583794275; cv=none; d=google.com; s=arc-20160816; b=DzRCHWpI3RHEtcbG+SZzOC+PEREa9Vv6dGkSTq5kgW00zoCO3vdjGSwKq2hRBvWOUZ Hszm/lYLHzm79owAiqNzEzxqRbuqzEFCD4tzGLxTSYUaFGJAIBYNVRBu/URQUFoLl0Yl T7mbFpmjUzkcHCW59Ut4a9FCECWnJdDBbK2zOSn4NqCp9aK5jSkNTDNc1BGwE6fS/08U zMerAhklhbaGMv19uB2VvLzqXWKa6g9WVP/6pgbJt2Alc1fqexXHYzdzdQ4QNekFTfNM ugmHlrZfB85fXypf9IUr/6uAXcIZMHNwxrNSCRrsLYpN2KI7qxJA+c4T+oiVT8Be9Ntf XRvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=HV3qgkcKTLqlj5wcbDRS2AXp9vzUwXBC/9+EqfzmMvM=; b=ytaPM9aieTF1ZJjh/Eafu1xqQ5Y4K6ZkWofx6GREpGLo+odcWD69+INvsQTw9MbK+2 veiUxoqYwmBF4MHF8ekUp8OZtJcCXZZ7I3JsayRSL2w64SxKU4xCCAniO4kJkAEW/GZi TH3mO4gJh6YgM1nmdaSxCLtFjTq3qTy4CaMhLqBgw3rW3iangOoQtoSYQqSnqOnIqYYj NBFA1uuQAel8Ik3NHI0+EIrOLZ8FOVYX1fwUYZrEXUNlGV3Pv5wvfIa0HolYSPKTtfkS RI72nlsaWY0m+brLTUJXlsQr+bG+GiS48PFObe5OLva6T+3ecvSrT7ExVaT++niSjVVA btGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HR21PSz2; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w79si4683058oia.18.2020.03.09.15.50.28; Mon, 09 Mar 2020 15:51:15 -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=@redhat.com header.s=mimecast20190719 header.b=HR21PSz2; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727356AbgCIWth (ORCPT + 99 others); Mon, 9 Mar 2020 18:49:37 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:57391 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727320AbgCIWth (ORCPT ); Mon, 9 Mar 2020 18:49:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583794175; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HV3qgkcKTLqlj5wcbDRS2AXp9vzUwXBC/9+EqfzmMvM=; b=HR21PSz2YUlAgq9+xbzW4xwXnvcwDMe/xXZ6fqabR1O3aLrgT2p1Vf3lWR+xgbkeqrHNw0 93zUl90kxIKimP/fUDunwcL3ajGLEEVMJXXYXb457Xs+B2IxA9WIHkjcaJtORYQd7pebls W1UTKAwDyNq/myibhxlHg5U6H3La+bI= Received: from mail-yw1-f71.google.com (mail-yw1-f71.google.com [209.85.161.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-44-kFCNyIp0PyKH-IhLQfTRyA-1; Mon, 09 Mar 2020 18:49:34 -0400 X-MC-Unique: kFCNyIp0PyKH-IhLQfTRyA-1 Received: by mail-yw1-f71.google.com with SMTP id o79so18087043ywo.14 for ; Mon, 09 Mar 2020 15:49:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=HV3qgkcKTLqlj5wcbDRS2AXp9vzUwXBC/9+EqfzmMvM=; b=TxIaNB9GhnMFpiyvKceybbHMtt+cSRpzq8F13b36sioPGmy5O146aEig1ImyH3Vh5Z 7kvtRVoP4P/iDtd44p21BdT8Z0JLWYtUfZx3w55ja3GO172uVtd5hqf/fgIprwSns/u9 Iu6ovrUAfSlxGQMjhRfo3uJDJZC6JneM2JR9UNUsQsd05ZohKMMKu8LVar7pYX5GMu8N oeRXyc9ps9Z77awLbdENLVPHUdy9llXX/FVSIQBQWSuZTZ0mDacjG/ORI6ewgC02KYfj 7uddzK19fdUGJ8ahGD2ZaPgIOMcY76p6698oaVdWI/oW4lp2x4+e3Dqa7DHAY+TgWC05 +ZHA== X-Gm-Message-State: ANhLgQ2JD+gAN3bTKYmu4TdmSZLLfGt9zw96ALKgf2mQlgJ/wlmM7qJf LG3toBd/CUs3WMjCmcqFptEBuYv+uqC92NME1MLrIBpS4d+Xc72aIyWCdqhCL50oZQ+sW9yO+X7 xMoQfS7FMTECKIUWnwQ/TkZpZ X-Received: by 2002:a25:2146:: with SMTP id h67mr19645206ybh.92.1583794173508; Mon, 09 Mar 2020 15:49:33 -0700 (PDT) X-Received: by 2002:a25:2146:: with SMTP id h67mr19645165ybh.92.1583794173070; Mon, 09 Mar 2020 15:49:33 -0700 (PDT) Received: from tleilax.poochiereds.net (68-20-15-154.lightspeed.rlghnc.sbcglobal.net. [68.20.15.154]) by smtp.gmail.com with ESMTPSA id w17sm3584845ywa.8.2020.03.09.15.49.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Mar 2020 15:49:32 -0700 (PDT) Message-ID: <32c384ac3adf0cf924d3071a13af7edffe53cc2b.camel@redhat.com> Subject: Re: [PATCH 00/14] VFS: Filesystem information [ver #18] From: Jeff Layton To: Andres Freund 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 Date: Mon, 09 Mar 2020 18:49:31 -0400 In-Reply-To: <20200309192240.nqf5bxylptw7mdm3@alap3.anarazel.de> References: <158376244589.344135.12925590041630631412.stgit@warthog.procyon.org.uk> <2d31e2658e5f6651dc7d9908c4c12b6ba461fc88.camel@redhat.com> <20200309192240.nqf5bxylptw7mdm3@alap3.anarazel.de> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.4 (3.34.4-1.fc31) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2020-03-09 at 12:22 -0700, Andres Freund wrote: > 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). Trying to interpret the counter field won't really tell you anything. The counter is not incremented unless someone has queried the value since it was last checked. A single increment could represent a single writeback error or 10000 identical ones. There _is_ a flag that tells you whether someone has queried it, but that gets masked off before copying the cookie to userland. > 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: > What problem would moving to a 64-bit counter solve? I get the concern about people trying to get a counter out of the cookie field, but giving people an explicit 64-bit counter seems even more open to misinterpretation. All that said, is an opaque cookie still something you'd find useful? > > 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? Good point. I'll do that in the next iteration. -- Jeff Layton