From e19fddfc6282ecc253a096464ca33e0c85e656f2 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Fri, 20 Feb 2015 23:55:07 +0000 Subject: [PATCH] inode: Fix bug in direct I/O with holes --- Kernel/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kernel/inode.c b/Kernel/inode.c index 7d5f68b8..e9793b93 100644 --- a/Kernel/inode.c +++ b/Kernel/inode.c @@ -61,7 +61,7 @@ void readi(inoptr ino, uint8_t flag) pblk = bmap(ino, udata.u_offset >> BLKSHIFT, 1); #if defined(read_direct) - if (!ispipe && amount == BLKSIZE && read_direct(flag) && bfind(dev, pblk) == 0) { + if (!ispipe && pblk != NULLBLK && amount == BLKSIZE && read_direct(flag) && bfind(dev, pblk) == 0) { /* we can transfer direct from disk to the userspace buffer */ off_t uostash; usize_t ucstash; -- 2.34.1