diff --git a/fs/iomap.c b/fs/iomap.c index e5de7725f18a7358b2cff497c9babd0a7b65f8e7..afd163586aa079f25ea86e5f56f8d85f25f2af68 100644 --- a/fs/iomap.c +++ b/fs/iomap.c @@ -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,