diff options
author | alc <alc@FreeBSD.org> | 2005-07-20 19:06:06 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2005-07-20 19:06:06 +0000 |
commit | 38bf328ab8a834dd02cd82fbbcbad6bb38ceced7 (patch) | |
tree | ac042e48ee290e496b46cceab5406a4b3b003617 /sys/ufs/ffs/ffs_vfsops.c | |
parent | 2854e6f54b01a61a10bb3567622c2db3b6756879 (diff) | |
download | FreeBSD-src-38bf328ab8a834dd02cd82fbbcbad6bb38ceced7.zip FreeBSD-src-38bf328ab8a834dd02cd82fbbcbad6bb38ceced7.tar.gz |
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
Diffstat (limited to 'sys/ufs/ffs/ffs_vfsops.c')
-rw-r--r-- | sys/ufs/ffs/ffs_vfsops.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index eeaf861..d80be58 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); /* |