mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 13:53:33 +00:00
iomap: iomap_write_failed fix
[ Upstream commitb71450e2cc
] The @lend parameter of truncate_pagecache_range() should be the offset of the last byte of the hole, not the first byte beyond it. Fixes:ae259a9c85
("fs: introduce iomap infrastructure") Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
9b76921de4
commit
7f9bb33df5
1 changed files with 2 additions and 1 deletions
|
@ -531,7 +531,8 @@ iomap_write_failed(struct inode *inode, loff_t pos, unsigned len)
|
|||
* write started inside the existing inode size.
|
||||
*/
|
||||
if (pos + len > i_size)
|
||||
truncate_pagecache_range(inode, max(pos, i_size), pos + len);
|
||||
truncate_pagecache_range(inode, max(pos, i_size),
|
||||
pos + len - 1);
|
||||
}
|
||||
|
||||
static int iomap_read_folio_sync(loff_t block_start, struct folio *folio,
|
||||
|
|
Loading…
Reference in a new issue