Message ID | 20170517121046.2632-3-jack@suse.cz (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c index f371812e20c6..8acb8ab79267 100644 --- a/fs/xfs/xfs_file.c +++ b/fs/xfs/xfs_file.c @@ -1097,7 +1097,7 @@ xfs_find_get_desired_pgoff( goto out; } /* Searching done if the page index is out of range. */ - if (page->index > end) + if (page->index >= end) goto out; lock_page(page); @@ -1153,7 +1153,7 @@ xfs_find_get_desired_pgoff( index = pvec.pages[i - 1]->index + 1; pagevec_release(&pvec); - } while (index <= end); + } while (index < end); out: pagevec_release(&pvec);
There is an off-by-one error in loop termination conditions in xfs_find_get_desired_pgoff(). It doesn't have any visible effects but still it is good to fix it. Signed-off-by: Jan Kara <jack@suse.cz> --- fs/xfs/xfs_file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)