lkml.org 
[lkml]   [2021]   [Oct]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 01/67] mm: Stop filemap_read() from grabbing a superfluous page
Date
Matthew Wilcox <willy@infradead.org> wrote:

> > + isize = i_size_read(inode);
> > + if (unlikely(iocb->ki_pos >= isize))
> > + goto put_pages;
> > +
>
> Is there a good reason to assign to isize here? I'd rather not,
> because it complicates analysis, and a later change might look at
> the isize read here, not realising it was a racy use. So I'd
> rather see:

If we don't set isize, the loop will never end. Actually, maybe we can just
break out at that point rather than going to put_pages.

David

\
 
 \ /
  Last update: 2021-10-19 20:48    [W:0.740 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site