diff options
Diffstat (limited to 'sys/fs/msdosfs/msdosfs_vnops.c')
-rw-r--r-- | sys/fs/msdosfs/msdosfs_vnops.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/fs/msdosfs/msdosfs_vnops.c b/sys/fs/msdosfs/msdosfs_vnops.c index 0a5cc48..210e9a8 100644 --- a/sys/fs/msdosfs/msdosfs_vnops.c +++ b/sys/fs/msdosfs/msdosfs_vnops.c @@ -815,6 +815,7 @@ msdosfs_fsync(ap) */ loop: s = splbio(); + VI_LOCK(vp); for (bp = TAILQ_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) { nbp = TAILQ_NEXT(bp, b_vnbufs); if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_NOWAIT)) @@ -823,13 +824,17 @@ loop: panic("msdosfs_fsync: not dirty"); bremfree(bp); splx(s); + VI_UNLOCK(vp); + /* XXX Could do bawrite */ (void) bwrite(bp); goto loop; } while (vp->v_numoutput) { - vp->v_flag |= VBWAIT; - (void) tsleep((caddr_t)&vp->v_numoutput, PRIBIO + 1, "msdosfsn", 0); + vp->v_vflag |= VI_BWAIT; + (void) msleep((caddr_t)&vp->v_numoutput, VI_MTX(vp), + PRIBIO + 1, "msdosfsn", 0); } + VI_UNLOCK(vp); #ifdef DIAGNOSTIC if (!TAILQ_EMPTY(&vp->v_dirtyblkhd)) { vprint("msdosfs_fsync: dirty", vp); |