iomap: fix integer truncation issues in the zeroing and dirtying helpers
authorChristoph Hellwig <hch@lst.de>
Sun, 17 Sep 2017 21:06:45 +0000 (14:06 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Sep 2017 06:19:59 +0000 (08:19 +0200)
commitec0d46ef8b7e35b4f7c82bcf12afbe96b711350f
tree33c567e0792b83e6f88a66f63f6396dd9e9f4c90
parente1a7b7e1f6c294f64602b9cb1c15d44432f48561
iomap: fix integer truncation issues in the zeroing and dirtying helpers

commit e28ae8e428fefe2facd72cea9f29906ecb9c861d upstream.

Fix the min_t calls in the zeroing and dirtying helpers to perform the
comparisms on 64-bit types, which prevents them from incorrectly
being truncated, and larger zeroing operations being stuck in a never
ending loop.

Special thanks to Markus Stockhausen for spotting the bug.

Reported-by: Paul Menzel <pmenzel@molgen.mpg.de>
Tested-by: Paul Menzel <pmenzel@molgen.mpg.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/iomap.c