mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 03:15:31 +09:00
iomap: avoid avoid truncating 64-bit offset to 32 bits
[ Upstream commit c13094b894de289514d84b8db56d1f2931a0bade ] on 32-bit kernels, iomap_write_delalloc_scan() was inadvertently using a 32-bit position due to folio_next_index() returning an unsigned long. This could lead to an infinite loop when writing to an xfs filesystem. Signed-off-by: Marco Nelissen <marco.nelissen@gmail.com> Link: https://lore.kernel.org/r/20250109041253.2494374-1-marco.nelissen@gmail.com Reviewed-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Christian Brauner <brauner@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
a5045ca6eb
commit
7ca4bd6b75
@@ -907,7 +907,7 @@ static int iomap_write_delalloc_scan(struct inode *inode,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* move offset to start of next folio in range */
|
/* move offset to start of next folio in range */
|
||||||
start_byte = folio_next_index(folio) << PAGE_SHIFT;
|
start_byte = folio_pos(folio) + folio_size(folio);
|
||||||
folio_unlock(folio);
|
folio_unlock(folio);
|
||||||
folio_put(folio);
|
folio_put(folio);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user