Stay at splbio across the VBWAIT loop, as is done elsewhere in the

kernel. Avoids a possible race condition. Pointed out by
enami@netbsd.org, problem reported by deberg@netbsd.org.
This commit is contained in:
fvdl 2000-10-24 14:43:32 +00:00
parent 251bc81879
commit ef6bdbccd8

View File

@ -1,4 +1,4 @@
/* $NetBSD: ffs_vnops.c,v 1.33 2000/09/19 22:04:10 fvdl Exp $ */
/* $NetBSD: ffs_vnops.c,v 1.34 2000/10/24 14:43:32 fvdl Exp $ */
/*
* Copyright (c) 1982, 1986, 1989, 1993
@ -277,8 +277,6 @@ loop:
goto loop;
}
splx(s);
/*
* Then, flush possibly unwritten indirect blocks. Without softdeps,
* these should be the only ones left.
@ -287,7 +285,6 @@ loop:
error = ufs_getlbns(vp, blk_high, ia, &num);
if (error != 0)
return error;
s = splbio();
for (i = 0; i < num; i++) {
ibp = incore(vp, ia[i].in_lbn);
if (ibp != NULL && !(ibp->b_flags & B_BUSY) &&
@ -298,7 +295,6 @@ loop:
s = splbio();
}
}
splx(s);
}
if (ap->a_flags & FSYNC_WAIT) {
@ -309,6 +305,8 @@ loop:
}
}
splx(s);
return (VOP_UPDATE(vp, NULL, NULL,
(ap->a_flags & FSYNC_WAIT) ? UPDATE_WAIT : 0));
}