mirror of
https://github.com/torvalds/linux
synced 2024-09-06 18:01:05 +00:00
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>
This commit is contained in:
parent
4b4c1326fd
commit
0c6dda7a1c
|
@ -65,6 +65,8 @@ iomap_apply(struct inode *inode, loff_t pos, loff_t length, unsigned flags,
|
|||
return ret;
|
||||
if (WARN_ON(iomap.offset > pos))
|
||||
return -EIO;
|
||||
if (WARN_ON(iomap.length == 0))
|
||||
return -EIO;
|
||||
|
||||
/*
|
||||
* Cut down the length to the one actually provided by the filesystem,
|
||||
|
|
Loading…
Reference in a new issue