aboutsummaryrefslogtreecommitdiff
path: root/sys/ufs
diff options
context:
space:
mode:
authorAlan Cox <alc@FreeBSD.org>2005-07-20 19:06:06 +0000
committerAlan Cox <alc@FreeBSD.org>2005-07-20 19:06:06 +0000
commitec9c9e7363753b1e6ab5cd296a8420d594252518 (patch)
treeac042e48ee290e496b46cceab5406a4b3b003617 /sys/ufs
parentde864c8710340aba4de81c6d0cef8c9ebe6ef981 (diff)
downloadsrc-ec9c9e7363753b1e6ab5cd296a8420d594252518.tar.gz
src-ec9c9e7363753b1e6ab5cd296a8420d594252518.zip
Eliminate inconsistency in the setting of the B_DONE flag. Specifically,
make the b_iodone callback responsible for setting it if it is needed. Previously, it was set unconditionally by bufdone() without holding whichever lock is shared by the b_iodone callback and the corresponding top-half function. Consequently, in a race, the top-half function could conclude that operation was done before the b_iodone callback finished. See, for example, aio_physwakeup() and aio_fphysio(). Note: I don't believe that the other, more widely-used b_iodone callbacks are affected. Discussed with: jeff Reviewed by: phk MFC after: 2 weeks
Notes
Notes: svn path=/head/; revision=148200
Diffstat (limited to 'sys/ufs')
-rw-r--r--sys/ufs/ffs/ffs_vfsops.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
index eeaf861a5a1d..d80be58d78f4 100644
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -1534,7 +1534,7 @@ ffs_backgroundwritedone(struct buf *bp)
* by biodone it will be tossed.
*/
bp->b_flags |= B_NOCACHE;
- bp->b_flags &= ~(B_CACHE | B_DONE);
+ bp->b_flags &= ~B_CACHE;
bufdone(bp);
BO_LOCK(bufobj);
/*