summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_aio.c
diff options
context:
space:
mode:
authorgreen <green@FreeBSD.org>2000-01-17 21:18:39 +0000
committergreen <green@FreeBSD.org>2000-01-17 21:18:39 +0000
commit24ae07bb544103d3ec8d898b4354778bb87bbf5b (patch)
tree547eabf3249b248cac6d6a08685f3e2d0beafc08 /sys/kern/vfs_aio.c
parent3f94f7df4e1e7719f049c6407f273f53b1f43cb4 (diff)
downloadFreeBSD-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/vfs_aio.c')
-rw-r--r--sys/kern/vfs_aio.c13
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);
OpenPOWER on IntegriCloud