Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Mar 1996 16:10:56 +0300
From:      vak@crox.net.kiae.su (Serge V.Vakulenko)
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   kern/1065: patch for wt driver
Message-ID:  <199603061310.QAA00489@crox.net.kiae.su>
Resent-Message-ID: <199603061320.FAA19626@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         1065
>Category:       kern
>Synopsis:       wt could crash reading short blocks
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Mar  6 05:20:01 PST 1996
>Last-Modified:
>Originator:     Serge V.Vakulenko
>Organization:
Cronyx Ltd., Moscow
>Release:        FreeBSD 2.1-STABLE i386
>Environment:

	FreeBSD 2.1 and Archive tape streamer

>Description:

	The system crashes when trying to read the tape
	using small block size (less than 2048 bytes).

>How-To-Repeat:

	dd bs=1 < /dev/rwt0 > /dev/null

>Fix:
	
--- wt21.c	Thu Sep 14 11:09:39 1995
+++ wt.c	Wed Mar  6 15:41:49 1996
@@ -634,8 +634,6 @@
 		DEBUG (("unexpected interrupt\n"));
 		return;
 	}
-	t->flags &= ~TPACTIVE;
-	t->dmacount += t->bsize;                /* increment counter */
 
 	/*
 	 * Clean up dma.
@@ -648,6 +646,10 @@
 	} else
 		isa_dmadone (t->dmaflags, t->dmavaddr, t->bsize, t->chan);
 
+	t->flags &= ~TPACTIVE;
+	t->dmacount += t->bsize;
+	t->dmavaddr += t->bsize;
+
 	/*
 	 * On exception, check for end of file and end of volume.
 	 */
@@ -663,7 +665,6 @@
 	}
 
 	if (t->dmacount < t->dmatotal) {        /* continue i/o */
-		t->dmavaddr += t->bsize;
 		wtdma (t);
 		DEBUG (("continue i/o, %d\n", t->dmacount));
 		return;

>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199603061310.QAA00489>