diff options
| author | Matthew Dillon <dillon@FreeBSD.org> | 2000-12-30 23:32:24 +0000 |
|---|---|---|
| committer | Matthew Dillon <dillon@FreeBSD.org> | 2000-12-30 23:32:24 +0000 |
| commit | 08c0a67b2e20eb392331584eddedaea7d317c1fd (patch) | |
| tree | 4fe2a570b5935648674782973b603faaf3187e4d /sys/miscfs | |
| parent | 6214433089c3cc6ce7e214b238920a45c911bdf7 (diff) | |
Notes
Diffstat (limited to 'sys/miscfs')
| -rw-r--r-- | sys/miscfs/specfs/spec_vnops.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sys/miscfs/specfs/spec_vnops.c b/sys/miscfs/specfs/spec_vnops.c index f3d7f11f0644..ba4655852c7a 100644 --- a/sys/miscfs/specfs/spec_vnops.c +++ b/sys/miscfs/specfs/spec_vnops.c @@ -352,12 +352,25 @@ spec_fsync(ap) return (0); /* + * MARK/SCAN initialization to avoid infinite loops + */ + s = splbio(); + for (bp = TAILQ_FIRST(&vp->v_dirtyblkhd); bp; + bp = TAILQ_NEXT(bp, b_vnbufs)) { + bp->b_flags &= ~B_SCANNED; + } + splx(s); + + /* * Flush all dirty buffers associated with a block device. */ loop: s = splbio(); for (bp = TAILQ_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) { nbp = TAILQ_NEXT(bp, b_vnbufs); + if ((bp->b_flags & B_SCANNED) != 0) + continue; + bp->b_flags |= B_SCANNED; if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_NOWAIT)) continue; if ((bp->b_flags & B_DELWRI) == 0) |
