diff options
author | jeff <jeff@FreeBSD.org> | 2003-03-02 06:05:23 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2003-03-02 06:05:23 +0000 |
commit | 8e95e9172221aabf5978f7f50ae2308a105d6f6c (patch) | |
tree | 976a25ee203ede9f82c16e1e88827ecb12847fba /sys/kern/vfs_bio.c | |
parent | 867cf33fa04654ebba5e14e5d7dda8839f2bef40 (diff) | |
download | FreeBSD-src-8e95e9172221aabf5978f7f50ae2308a105d6f6c.zip FreeBSD-src-8e95e9172221aabf5978f7f50ae2308a105d6f6c.tar.gz |
- Hold the vnode interlock across calls to bgetvp instead of acquiring it
internally. This is required to stop multiple bufs from being associated
with a single lblkno.
Diffstat (limited to 'sys/kern/vfs_bio.c')
-rw-r--r-- | sys/kern/vfs_bio.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index 368e1e0..10ad7dc 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -806,7 +806,10 @@ bwrite(struct buf * bp) memcpy(newbp->b_data, bp->b_data, bp->b_bufsize); newbp->b_lblkno = bp->b_lblkno; newbp->b_xflags |= BX_BKGRDMARKER; + /* XXX The BX_ flags need to be protected as well */ + VI_LOCK(bp->b_vp); bgetvp(bp->b_vp, newbp); + VI_UNLOCK(bp->b_vp); newbp->b_blkno = bp->b_blkno; newbp->b_offset = bp->b_offset; newbp->b_iodone = vfs_backgroundwritedone; @@ -2554,7 +2557,6 @@ loop: brelse(bp); goto loop; } - VI_UNLOCK(vp); /* * Insert the buffer into the hash, so that it can @@ -2564,6 +2566,7 @@ loop: bp->b_offset = offset; bgetvp(vp, bp); + VI_UNLOCK(vp); /* * set B_VMIO bit. allocbuf() the buffer bigger. Since the |