Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iomap: warn on zero-length mappings

Don't let the iomap callback get away with feeding us a garbage zero
length mapping -- there was a bug in xfs that resulted in those leaking
out to hilarious effect.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>

+2
+2
fs/iomap.c
··· 65 65 return ret; 66 66 if (WARN_ON(iomap.offset > pos)) 67 67 return -EIO; 68 + if (WARN_ON(iomap.length == 0)) 69 + return -EIO; 68 70 69 71 /* 70 72 * Cut down the length to the one actually provided by the filesystem,