diff options
author | Jeff Roberson <jeff@FreeBSD.org> | 2003-03-13 07:19:23 +0000 |
---|---|---|
committer | Jeff Roberson <jeff@FreeBSD.org> | 2003-03-13 07:19:23 +0000 |
commit | 09f11da5a31d792654cf17c5f7a97bbee1fd9253 (patch) | |
tree | 42c64ebfa800452a8af9d33feb3e347c047240a9 /sys/ufs | |
parent | f5f0dee483c61984be6324b3514a732f814c6899 (diff) | |
download | src-09f11da5a31d792654cf17c5f7a97bbee1fd9253.tar.gz src-09f11da5a31d792654cf17c5f7a97bbee1fd9253.zip |
- 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.
Notes
Notes:
svn path=/head/; revision=112181
Diffstat (limited to 'sys/ufs')
-rw-r--r-- | sys/ufs/ffs/ffs_vnops.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index cc6debc12f0d..8aa3db4cb21b 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. |