[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200309192240.nqf5bxylptw7mdm3@alap3.anarazel.de>
Date: Mon, 9 Mar 2020 12:22:40 -0700
From: Andres Freund <andres@...razel.de>
To: Jeff Layton <jlayton@...hat.com>
Cc: David Howells <dhowells@...hat.com>, torvalds@...ux-foundation.org,
viro@...iv.linux.org.uk, Theodore Ts'o <tytso@....edu>,
Stefan Metzmacher <metze@...ba.org>,
Andreas Dilger <adilger.kernel@...ger.ca>,
linux-ext4@...r.kernel.org, Aleksa Sarai <cyphar@...har.com>,
Trond Myklebust <trond.myklebust@...merspace.com>,
Anna Schumaker <anna.schumaker@...app.com>,
linux-nfs@...r.kernel.org, linux-api@...r.kernel.org,
raven@...maw.net, mszeredi@...hat.com, christian@...uner.io,
jannh@...gle.com, darrick.wong@...cle.com, kzak@...hat.com,
linux-fsdevel@...r.kernel.org,
linux-security-module@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 00/14] VFS: Filesystem information [ver #18]
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
Powered by blists - more mailing lists