diff options
author | green <green@FreeBSD.org> | 2000-01-17 21:18:39 +0000 |
---|---|---|
committer | green <green@FreeBSD.org> | 2000-01-17 21:18:39 +0000 |
commit | 24ae07bb544103d3ec8d898b4354778bb87bbf5b (patch) | |
tree | 547eabf3249b248cac6d6a08685f3e2d0beafc08 /sys/kern | |
parent | 3f94f7df4e1e7719f049c6407f273f53b1f43cb4 (diff) | |
download | FreeBSD-src-24ae07bb544103d3ec8d898b4354778bb87bbf5b.zip FreeBSD-src-24ae07bb544103d3ec8d898b4354778bb87bbf5b.tar.gz |
Fix vn_isdisk() usage to make AIO work on non-disk-files again, rather
than just return ENOTBLK.
PR: 16163
Submitted by: Adrian Chadd <adrian@FreeBSD.org>
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/vfs_aio.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c index 5fc3c2c..fa953cd 100644 --- a/sys/kern/vfs_aio.c +++ b/sys/kern/vfs_aio.c @@ -944,8 +944,17 @@ aio_qphysio(struct proc *p, struct aiocblist *aiocbe) vp = (struct vnode *)fp->f_data; - if (!vn_isdisk(vp, &error)) - return (error); + /* + * If its not a disk, we don't want to return a positive error. + * It causes the aio code to not fall through to try the thread + * way when you're talking to a regular file. + */ + if (!vn_isdisk(vp, &error)) { + if (error == ENOTBLK) + return (-1); + else + return (error); + } if (cb->aio_nbytes % vp->v_rdev->si_bsize_phys) return (-1); |