Commit 7161ee20 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] fadvise(POSIX_FADV_DONTNEED) fix

invalidate_mapping_pages() takes start/end, but fadvise is currently passing
it start/len.
parent 310b411f
......@@ -26,6 +26,8 @@ long sys_fadvise64(int fd, loff_t offset, size_t len, int advice)
struct inode *inode;
struct address_space *mapping;
struct backing_dev_info *bdi;
pgoff_t start_index;
pgoff_t end_index;
int ret = 0;
if (!file)
......@@ -65,8 +67,10 @@ long sys_fadvise64(int fd, loff_t offset, size_t len, int advice)
case POSIX_FADV_DONTNEED:
if (!bdi_write_congested(mapping->backing_dev_info))
filemap_flush(mapping);
invalidate_mapping_pages(mapping, offset >> PAGE_CACHE_SHIFT,
(len >> PAGE_CACHE_SHIFT) + 1);
start_index = offset >> PAGE_CACHE_SHIFT;
end_index = (offset + len + PAGE_CACHE_SIZE - 1) >>
PAGE_CACHE_SHIFT;
invalidate_mapping_pages(mapping, start_index, end_index);
break;
default:
ret = -EINVAL;
......
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