Commit 3172485f authored by Jeff Moyer's avatar Jeff Moyer Committed by Linus Torvalds

block_invalidatepage(): only release page if the full page was invalidated

Prior to commit d47992f8 ("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/x49fu5rtnzs.fsf@segfault.boston.devel.redhat.com
Fixes: d47992f8 ("mm: change invalidatepage prototype to accept length")
Signed-off-by: default avatarJeff Moyer <jmoyer@redhat.com>
Reviewed-by: default avatarJan Kara <jack@suse.cz>
Cc: Lukas Czerner <lczerner@redhat.com>
Cc: Hugh Dickins <hughd@google.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent e8b098fc
...@@ -1511,7 +1511,7 @@ void block_invalidatepage(struct page *page, unsigned int offset, ...@@ -1511,7 +1511,7 @@ void block_invalidatepage(struct page *page, unsigned int offset,
* The get_block cached value has been unconditionally invalidated, * The get_block cached value has been unconditionally invalidated,
* so real IO is not possible anymore. * so real IO is not possible anymore.
*/ */
if (offset == 0) if (length == PAGE_SIZE)
try_to_release_page(page, 0); try_to_release_page(page, 0);
out: out:
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment