diff options
-rw-r--r-- | fs/iomap.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/iomap.c b/fs/iomap.c index 432eed8f091f..16f5c07451bf 100644 --- a/fs/iomap.c +++ b/fs/iomap.c | |||
@@ -610,8 +610,8 @@ iomap_seek_hole(struct inode *inode, loff_t offset, const struct iomap_ops *ops) | |||
610 | loff_t length = size - offset; | 610 | loff_t length = size - offset; |
611 | loff_t ret; | 611 | loff_t ret; |
612 | 612 | ||
613 | /* Nothing to be found beyond the end of the file. */ | 613 | /* Nothing to be found before or beyond the end of the file. */ |
614 | if (offset >= size) | 614 | if (offset < 0 || offset >= size) |
615 | return -ENXIO; | 615 | return -ENXIO; |
616 | 616 | ||
617 | while (length > 0) { | 617 | while (length > 0) { |
@@ -656,8 +656,8 @@ iomap_seek_data(struct inode *inode, loff_t offset, const struct iomap_ops *ops) | |||
656 | loff_t length = size - offset; | 656 | loff_t length = size - offset; |
657 | loff_t ret; | 657 | loff_t ret; |
658 | 658 | ||
659 | /* Nothing to be found beyond the end of the file. */ | 659 | /* Nothing to be found before or beyond the end of the file. */ |
660 | if (offset >= size) | 660 | if (offset < 0 || offset >= size) |
661 | return -ENXIO; | 661 | return -ENXIO; |
662 | 662 | ||
663 | while (length > 0) { | 663 | while (length > 0) { |