2021-01-21 20:11:45

by David Howells

[permalink] [raw]
Subject: Re: [RFC][PATCH 00/25] Network fs helper library & fscache kiocb API

J. Bruce Fields <[email protected]> wrote:

> > J. Bruce Fields <[email protected]> wrote:
> >
> > > > Fixing this requires a much bigger overhaul of cachefiles than this patchset
> > > > performs.
> > >
> > > That sounds like "sometimes you may get file corruption and there's
> > > nothing you can do about it". But I know people actually use fscache,
> > > so it must be reliable at least for some use cases.
> >
> > Yes. That's true for the upstream code because that uses bmap.
>
> Sorry, when you say "that's true", what part are you referring to?

Sometimes, theoretically, you may get file corruption due to this.

> > I'm switching
> > to use SEEK_HOLE/SEEK_DATA to get rid of the bmap usage, but it doesn't change
> > the issue.
> >
> > > Is it that those "bridging" blocks only show up in certain corner cases
> > > that users can arrange to avoid? Or that it's OK as long as you use
> > > certain specific file systems whose behavior goes beyond what's
> > > technically required by the bamp or seek interfaces?
> >
> > That's a question for the xfs, ext4 and btrfs maintainers, and may vary
> > between kernel versions and fsck or filesystem packing utility versions.
>
> So, I'm still confused: there must be some case where we know fscache
> actually works reliably and doesn't corrupt your data, right?

Using ext2/3, for example. I don't know under what circumstances xfs, ext4
and btrfs might insert/remove blocks of zeros, but I'm told it can happen.

David


2021-01-22 16:03:31

by J. Bruce Fields

[permalink] [raw]
Subject: Re: [RFC][PATCH 00/25] Network fs helper library & fscache kiocb API

On Thu, Jan 21, 2021 at 08:08:24PM +0000, David Howells wrote:
> J. Bruce Fields <[email protected]> wrote:
> > So, I'm still confused: there must be some case where we know fscache
> > actually works reliably and doesn't corrupt your data, right?
>
> Using ext2/3, for example. I don't know under what circumstances xfs, ext4
> and btrfs might insert/remove blocks of zeros, but I'm told it can happen.

Do ext2/3 work well for fscache in other ways?

--b.