There is an off-by-one error in loop termination conditions in
ext4_find_unwritten_pgoff() since 'end' may index a page beyond end of
desired range if 'endoff' is page aligned. It doesn't have any visible
effects but still it is good to fix it.
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Orabug:
27093425
(backport upstream commit
3f1d5bad3fae983da07be01cff2fde13293bb7b9)
Signed-off-by: Shan Hai <shan.hai@oracle.com>
endoff = (loff_t)(map->m_lblk + map->m_len) << blkbits;
index = startoff >> PAGE_CACHE_SHIFT;
- end = endoff >> PAGE_CACHE_SHIFT;
+ end = (endoff - 1) >> PAGE_CACHE_SHIFT;
pagevec_init(&pvec, 0);
do {