Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1253811c authored by Andreas Gruenbacher's avatar Andreas Gruenbacher Committed by Greg Kroah-Hartman
Browse files

iomap: iomap_write_failed fix



[ Upstream commit b71450e2cc4b3c79f33c5bd276d152af9bd54f79 ]

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: ae259a9c ("fs: introduce iomap infrastructure")
Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
Reviewed-by: default avatarDarrick J. Wong <djwong@kernel.org>
Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 6b8291e5
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -535,7 +535,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