lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 09 Jan 2023 09:31:00 -0500
From:   Jeff Layton <jlayton@...hat.com>
To:     Matthew Wilcox <willy@...radead.org>
Cc:     linux-fsdevel@...r.kernel.org, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org, Christoph Hellwig <hch@....de>
Subject: Re: [PATCH 02/11] filemap: Remove filemap_check_and_keep_errors()

On Mon, 2023-01-09 at 14:02 +0000, Matthew Wilcox wrote:
> On Mon, Jan 09, 2023 at 08:48:49AM -0500, Jeff Layton wrote:
> > On Mon, 2023-01-09 at 05:18 +0000, Matthew Wilcox (Oracle) wrote:
> > > Convert both callers to use the "new" errseq infrastructure.
> > 
> > I looked at making this sort of change across the board alongside the
> > original wb_err patches, but I backed off at the time.
> > 
> > With the above patch, this function will no longer report a writeback
> > error that occurs before the sample. Given that writeback can happen at
> > any time, that seemed like it might be an undesirable change, and I
> > didn't follow through.
> > 
> > It is true that the existing flag-based code may miss errors too, if
> > multiple tasks are test_and_clear'ing the bits, but I think the above is
> > even more likely to happen, esp. under memory pressure.
> > 
> > To do this right, we probably need to look at these callers and have
> > them track a long-term errseq_t "since" value before they ever dirty the
> > pages, and then continually check-and-advance vs. that.
> > 
> > For instance, the main caller of the above function is jbd2. Would it be
> > reasonable to add in a new errseq_t value to the jnode for tracking
> > errors?
> 
> Doesn't b4678df184b3 address this problem?  If nobody has seen the
> error, we return 0 instead of the current value of wb_err, ensuring
> that somebody always sees the error.
> 

I was originally thinking no, but now I think you're correct.

We do initialize the "since" value to 0 if an error has never been seen,
so that (sort of) emulates the behavior of the existing AS_EIO/AS_ENOSPC
flags.

It's still not quite as reliable as plumbing a "since" value through all
of the callers (particularly in the case where there are multiple
waiters), but maybe it's good enough here.

I'll look over the rest of the set.

Thanks,
--
Jeff Layton <jlayton@...hat.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ