summaryrefslogtreecommitdiffstats
path: root/sys/ufs
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2003-03-13 07:19:23 +0000
committerjeff <jeff@FreeBSD.org>2003-03-13 07:19:23 +0000
commitae3c8799daed67832db23a2957d5f5e47250cad9 (patch)
tree42c64ebfa800452a8af9d33feb3e347c047240a9 /sys/ufs
parent8ee94afd309724ae0e8434dc6ff0158da0d7addf (diff)
downloadFreeBSD-src-ae3c8799daed67832db23a2957d5f5e47250cad9.zip
FreeBSD-src-ae3c8799daed67832db23a2957d5f5e47250cad9.tar.gz
- Remove a race between fsync like functions and flushbufqueues() by
requiring locked bufs in vfs_bio_awrite(). Previously the buf could have been written out by fsync before we acquired the buf lock if it weren't for giant. The cluster_wbuild() handles this race properly but the single write at the end of vfs_bio_awrite() would not. - Modify flushbufqueues() so there is only one copy of the loop. Pass a parameter in that says whether or not we should sync bufs with deps. - Call flushbufqueues() a second time and then break if we couldn't find any bufs without deps.
Diffstat (limited to 'sys/ufs')
-rw-r--r--sys/ufs/ffs/ffs_vnops.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c
index cc6debc..8aa3db4 100644
--- a/sys/ufs/ffs/ffs_vnops.c
+++ b/sys/ufs/ffs/ffs_vnops.c
@@ -227,7 +227,6 @@ loop:
*/
if (passes > 0 || !wait) {
if ((bp->b_flags & B_CLUSTEROK) && !wait) {
- BUF_UNLOCK(bp);
(void) vfs_bio_awrite(bp);
} else {
bremfree(bp);
@@ -252,10 +251,9 @@ loop:
splx(s);
brelse(bp);
s = splbio();
- } else {
- BUF_UNLOCK(bp);
+ } else
vfs_bio_awrite(bp);
- }
+
/*
* Since we may have slept during the I/O, we need
* to start from a known point.
OpenPOWER on IntegriCloud