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

Must call drain_output() before checking the dirty block list

in softdep_sync_metadata(). Otherwise we may miss dependencies
that need to be flushed which will result in a later panic
with the message ``vinvalbuf: dirty bufs''.

Submitted by:	Matthew Dillon <dillon@apollo.backplane.com>
MFC after:	1 week
This commit is contained in:
Kirk McKusick 2002-01-11 19:59:27 +00:00
parent aee4cebfe7
commit 794ef3471f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=89270

View File

@ -4344,6 +4344,11 @@ softdep_sync_metadata(ap)
*/
waitfor = MNT_NOWAIT;
top:
/*
* We must wait for any I/O in progress to finish so that
* all potential buffers on the dirty list will be visible.
*/
drain_output(vp, 1);
if (getdirtybuf(&TAILQ_FIRST(&vp->v_dirtyblkhd), MNT_WAIT) == 0) {
FREE_LOCK(&lk);
return (0);
@ -4501,16 +4506,9 @@ softdep_sync_metadata(ap)
bp = nbp;
goto loop;
}
/*
* We must wait for any I/O in progress to finish so that
* all potential buffers on the dirty list will be visible.
* Once they are all there, proceed with the second pass
* which will wait for the I/O as per above.
*/
drain_output(vp, 1);
/*
* The brief unlock is to allow any pent up dependency
* processing to be done.
* processing to be done. Then proceed with the second pass.
*/
if (waitfor == MNT_NOWAIT) {
waitfor = MNT_WAIT;
@ -4523,7 +4521,11 @@ softdep_sync_metadata(ap)
* If we have managed to get rid of all the dirty buffers,
* then we are done. For certain directories and block
* devices, we may need to do further work.
*
* We must wait for any I/O in progress to finish so that
* all potential buffers on the dirty list will be visible.
*/
drain_output(vp, 1);
if (TAILQ_FIRST(&vp->v_dirtyblkhd) == NULL) {
FREE_LOCK(&lk);
return (0);