Re: [v4.9 Regression] vfs,mm: fix a dead loop in truncate_inode_pages_range()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Dec 14, 2016 at 1:27 PM, Linus Torvalds
<torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> That said, I wonder if we instead should get rid of that truncation
> entirely, and just do the s_maxbytes test inside the loop? Or perhaps
> just modify the last_index calculations - screw the "s_maxbytes" part,
> it's really the last index that matters.

Actually, let's ignore s_maxbytes *entirely*, and just check against
i_size_read() before each page.

Yes,. we need to check it *after* getting the page too (like we
already do), because of races. But if somebody is reading past the end
of the file, why bother creating the empty page cache entry?

What do you think?

                Linus
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]