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