diff options
author | Alan Cox <alc@FreeBSD.org> | 2005-07-20 19:06:06 +0000 |
---|---|---|
committer | Alan Cox <alc@FreeBSD.org> | 2005-07-20 19:06:06 +0000 |
commit | ec9c9e7363753b1e6ab5cd296a8420d594252518 (patch) | |
tree | ac042e48ee290e496b46cceab5406a4b3b003617 /sys/kern/vfs_bio.c | |
parent | de864c8710340aba4de81c6d0cef8c9ebe6ef981 (diff) | |
download | src-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/kern/vfs_bio.c')
-rw-r--r-- | sys/kern/vfs_bio.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index d3ef32c48b6d..594606296948 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -3046,7 +3046,6 @@ bufdone(struct buf *bp) if (bp->b_iodone != NULL) { biodone = bp->b_iodone; bp->b_iodone = NULL; - bp->b_flags |= B_DONE; (*biodone) (bp); if (dropobj) bufobj_wdrop(dropobj); |