Skip to content

Commit c663e29

Browse files
jankaradchinner
authored andcommitted
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 <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Dave Chinner <[email protected]>
1 parent 64e6428 commit c663e29

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

fs/iomap.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,8 +433,7 @@ iomap_page_mkwrite_actor(struct inode *inode, loff_t pos, loff_t length,
433433
struct page *page = data;
434434
int ret;
435435

436-
ret = __block_write_begin_int(page, pos & ~PAGE_MASK, length,
437-
NULL, iomap);
436+
ret = __block_write_begin_int(page, pos, length, NULL, iomap);
438437
if (ret)
439438
return ret;
440439

0 commit comments

Comments
 (0)