MFC 1.55 - fix an invalidation case which primarily occurs on NFS servers.
authorMatthew Dillon <dillon@dragonflybsd.org>
Mon, 15 Sep 2008 17:10:03 +0000 (15 17:10 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Mon, 15 Sep 2008 17:10:03 +0000 (15 17:10 +0000)
sys/vfs/hammer/hammer_io.c

index 20127db..2f71c5b 100644 (file)
@@ -31,7 +31,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * 
- * $DragonFly: src/sys/vfs/hammer/hammer_io.c,v 1.49.2.4 2008/08/06 15:41:56 dillon Exp $
+ * $DragonFly: src/sys/vfs/hammer/hammer_io.c,v 1.49.2.5 2008/09/15 17:10:03 dillon Exp $
  */
 /*
  * IO Primitives and buffer cache management
@@ -272,17 +272,19 @@ hammer_io_inval(hammer_volume_t volume, hammer_off_t zone2_offset)
                hammer_ref(&iou->io.lock);
                hammer_io_clear_modify(&iou->io, 1);
                bundirty(bp);
+               iou->io.released = 0;
+               BUF_KERNPROC(bp);
                iou->io.reclaim = 1;
                iou->io.waitdep = 1;
-               KKASSERT(iou->io.lock.refs == 0);
+               KKASSERT(iou->io.lock.refs == 1);
                hammer_rel_buffer(&iou->buffer, 0);
                /*hammer_io_deallocate(bp);*/
        } else {
                KKASSERT((bp->b_flags & B_LOCKED) == 0);
                bundirty(bp);
                bp->b_flags |= B_NOCACHE|B_RELBUF;
+               brelse(bp);
        }
-       brelse(bp);
        crit_exit();
 }