mm/filemap: fix miscalculated file range for filemap_fdatawrite_range_kick()
iocb->ki_pos has been updated with the number of written bytes since
generic_perform_write().
Besides __filemap_fdatawrite_range() accepts the inclusive end of the
data range.
Fixes: 1d44575765
("mm: call filemap_fdatawrite_range_kick() after IOCB_DONTCACHE issue")
Signed-off-by: Jingbo Xu <jefflexu@linux.alibaba.com>
Link: https://lore.kernel.org/r/20250218120209.88093-2-jefflexu@linux.alibaba.com
Reviewed-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
parent
b4c173dfbb
commit
8510edf191
2 changed files with 3 additions and 3 deletions
|
@ -2975,8 +2975,8 @@ static inline ssize_t generic_write_sync(struct kiocb *iocb, ssize_t count)
|
|||
} else if (iocb->ki_flags & IOCB_DONTCACHE) {
|
||||
struct address_space *mapping = iocb->ki_filp->f_mapping;
|
||||
|
||||
filemap_fdatawrite_range_kick(mapping, iocb->ki_pos,
|
||||
iocb->ki_pos + count);
|
||||
filemap_fdatawrite_range_kick(mapping, iocb->ki_pos - count,
|
||||
iocb->ki_pos - 1);
|
||||
}
|
||||
|
||||
return count;
|
||||
|
|
|
@ -445,7 +445,7 @@ EXPORT_SYMBOL(filemap_fdatawrite_range);
|
|||
* filemap_fdatawrite_range_kick - start writeback on a range
|
||||
* @mapping: target address_space
|
||||
* @start: index to start writeback on
|
||||
* @end: last (non-inclusive) index for writeback
|
||||
* @end: last (inclusive) index for writeback
|
||||
*
|
||||
* This is a non-integrity writeback helper, to start writing back folios
|
||||
* for the indicated range.
|
||||
|
|
Loading…
Add table
Reference in a new issue