diff options
author | Jan Kara <jack@suse.cz> | 2016-10-24 06:20:25 +0300 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2016-10-24 06:20:25 +0300 |
commit | c663e29f8885269c1608b5aa6057729fa9267b35 (patch) | |
tree | fffb106bd365d9f74d14ef9519edbf265e9f228a /fs/iomap.c | |
parent | 64e6428ddd00f864e3ca105f914a2b6920c2bc41 (diff) | |
download | linux-c663e29f8885269c1608b5aa6057729fa9267b35.tar.xz |
fs: Do to trim high file position bits in iomap_page_mkwrite_actor
iomap_page_mkwrite_actor() calls __block_write_begin_int() with position
masked as pos & ~PAGE_MASK which is equivalent to pos & (PAGE_SIZE-1).
Thus it masks off high bits of file position. However
__block_write_begin_int() expects full file position on input. This does
not cause any visible issues because all __block_write_begin_int()
really cares about are low file position bits but still it is a bug
waiting to happen.
Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/iomap.c')
-rw-r--r-- | fs/iomap.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/iomap.c b/fs/iomap.c index a92204012e2d..a8ee8c33ca78 100644 --- a/fs/iomap.c +++ b/fs/iomap.c @@ -433,8 +433,7 @@ iomap_page_mkwrite_actor(struct inode *inode, loff_t pos, loff_t length, struct page *page = data; int ret; - ret = __block_write_begin_int(page, pos & ~PAGE_MASK, length, - NULL, iomap); + ret = __block_write_begin_int(page, pos, length, NULL, iomap); if (ret) return ret; |