1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-14 10:09:48 +00:00

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>
This commit is contained in:
Brian Feldman 2000-01-17 21:18:39 +00:00
parent 96cdb64ea9
commit f582ac0630
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=56203

View File

@ -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);