mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-12 09:58:36 +00:00
vinvalbuf() was only waiting for write-I/O to complete. It really has to
wait for both read AND write I/O to complete. Only NFS calls vinvalbuf() on an active vnode (when the server indicates that the file is stale), so this bug fix only effects NFS clients. MFC after: 3 days
This commit is contained in:
parent
23620bde07
commit
845bd795c9
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=84561
@ -826,10 +826,21 @@ vinvalbuf(vp, flags, cred, td, slpflag, slptimeo)
|
||||
}
|
||||
}
|
||||
|
||||
while (vp->v_numoutput > 0) {
|
||||
vp->v_flag |= VBWAIT;
|
||||
tsleep(&vp->v_numoutput, PVM, "vnvlbv", 0);
|
||||
}
|
||||
/*
|
||||
* Wait for I/O to complete. XXX needs cleaning up. The vnode can
|
||||
* have write I/O in-progress but if there is a VM object then the
|
||||
* VM object can also have read-I/O in-progress.
|
||||
*/
|
||||
do {
|
||||
while (vp->v_numoutput > 0) {
|
||||
vp->v_flag |= VBWAIT;
|
||||
tsleep(&vp->v_numoutput, PVM, "vnvlbv", 0);
|
||||
}
|
||||
if (VOP_GETVOBJECT(vp, &object) == 0) {
|
||||
while (object->paging_in_progress)
|
||||
vm_object_pip_sleep(object, "vnvlbx");
|
||||
}
|
||||
} while (vp->v_numoutput > 0);
|
||||
|
||||
splx(s);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user