From: Alan Cox Date: Fri, 20 Feb 2015 23:55:07 +0000 (+0000) Subject: inode: Fix bug in direct I/O with holes X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=e19fddfc6282ecc253a096464ca33e0c85e656f2;p=FUZIX.git inode: Fix bug in direct I/O with holes --- 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;