Skip to content

Commit

Permalink
block_invalidatepage(): only release page if the full page was invali…
Browse files Browse the repository at this point in the history
…dated

Prior to commit d47992f ("mm: change invalidatepage prototype to
accept length"), an offset of 0 meant that the full page was being
invalidated.  After that commit, we need to instead check the length.

Jan said:
:
: The only possible issue is that try_to_release_page() was called more
: often than necessary.  Otherwise the issue is harmless but still it's good
: to have this fixed.

Link: http://lkml.kernel.org/r/[email protected]
Fixes: d47992f ("mm: change invalidatepage prototype to accept length")
Signed-off-by: Jeff Moyer <[email protected]>
Reviewed-by: Jan Kara <[email protected]>
Cc: Lukas Czerner <[email protected]>
Cc: Hugh Dickins <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
JeffMoyer authored and torvalds committed Apr 6, 2018
1 parent e8b098f commit 3172485
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1511,7 +1511,7 @@ void block_invalidatepage(struct page *page, unsigned int offset,
* The get_block cached value has been unconditionally invalidated,
* so real IO is not possible anymore.
*/
if (offset == 0)
if (length == PAGE_SIZE)
try_to_release_page(page, 0);
out:
return;
Expand Down

0 comments on commit 3172485

Please sign in to comment.