[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=whRuPkm7zFUiGe_BXkLvEdShZGngkb=uRufgU65ogCxfg@mail.gmail.com>
Date: Mon, 25 Nov 2019 09:05:29 -0800
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Steven Whitehouse <swhiteho@...hat.com>
Cc: Andreas Grünbacher <andreas.gruenbacher@...il.com>,
Konstantin Khlebnikov <khlebnikov@...dex-team.ru>,
"Kirill A. Shutemov" <kirill@...temov.name>,
Linux-MM <linux-mm@...ck.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-fsdevel <linux-fsdevel@...r.kernel.org>,
Alexander Viro <viro@...iv.linux.org.uk>,
Johannes Weiner <hannes@...xchg.org>,
"cluster-devel@...hat.com" <cluster-devel@...hat.com>,
Ronnie Sahlberg <lsahlber@...hat.com>,
Steve French <sfrench@...ba.org>,
Andreas Gruenbacher <agruenba@...hat.com>,
Bob Peterson <rpeterso@...hat.com>
Subject: Re: [PATCH] mm/filemap: do not allocate cache pages beyond end of
file at read
On Mon, Nov 25, 2019 at 2:53 AM Steven Whitehouse <swhiteho@...hat.com> wrote:
>
> Linus, is that roughly what you were thinking of?
So the concept looks ok, but I don't really like the new flags as they
seem to be gfs2-specific rather than generic.
That said, I don't _gate_ them either, since they aren't in any
critical code sequence, and it's not like they do anything really odd.
I still think the whole gfs2 approach is broken. You're magically ok
with using stale data from the cache just because it's cached, even if
another client might have truncated the file or something.
So you're ok with saying "the file used to be X bytes in size, so
we'll just give you this data because we trust that the X is correct".
But you're not ok to say "oh, the file used to be X bytes in size, but
we don't want to give you a short read because it might not be correct
any more".
See the disconnect? You trust the size in one situation, but not in another one.
I also don't really see that you *need* the new flag at all. Since
you're doing to do a speculative read and then a real read anyway, and
since the only thing that you seem to care about is the file size
(because the *data* you will trust if it is cached), then why don't
you just use the *existing* generic read, and *IFF* you get a
truncated return value, then you go and double-check that the file
hasn't changed in size?
See what I'm saying? I think gfs2 is being very inconsistent in when
it trusts the file size, and I don't see that you even need the new
behavior that patch gives, because you might as well just use the
existing code (just move the i_size check earlier, and then teach gfs2
to double-check the "I didn't get as much as I expected" case).
Linus
Powered by blists - more mailing lists