Commit 79ef517b authored by Nathan Straz's avatar Nathan Straz Committed by Nathan Scott

[XFS] Use unsigned long long for end_offset so we don't overflow it.

SGI Modid: xfs-linux:xfs-kern:168809a
parent 57128c12
......@@ -717,7 +717,8 @@ xfs_page_state_convert(
struct buffer_head *bh_arr[MAX_BUF_PER_PAGE], *bh, *head;
xfs_iomap_t *iomp, iomap;
unsigned long p_offset = 0, end_index;
loff_t offset, end_offset;
loff_t offset;
unsigned long long end_offset;
int len, err, i, cnt = 0, uptodate = 1;
int flags = startio ? 0 : BMAPI_TRYLOCK;
int page_dirty = 1;
......@@ -734,9 +735,8 @@ xfs_page_state_convert(
}
offset = (loff_t)page->index << PAGE_CACHE_SHIFT;
end_offset = offset + PAGE_CACHE_SIZE;
if (end_offset > i_size_read(inode))
end_offset = i_size_read(inode);
end_offset = min_t(unsigned long long,
offset + PAGE_CACHE_SIZE, i_size_read(inode));
bh = head = page_buffers(page);
iomp = NULL;
......
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