From spartak@corwin.aif.ru  Sun Sep 14 10:03:18 2003
Return-Path: <spartak@corwin.aif.ru>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP
	id 4B33C16A4BF; Sun, 14 Sep 2003 10:03:18 -0700 (PDT)
Received: from corwin.aif.ru (corwin.aif.ru [212.15.98.3])
	by mx1.FreeBSD.org (Postfix) with ESMTP
	id 2429D43FBF; Sun, 14 Sep 2003 10:03:17 -0700 (PDT)
	(envelope-from spartak@corwin.aif.ru)
Received: from corwin.aif.ru (localhost [127.0.0.1])
	by corwin.aif.ru (8.12.9/8.12.9) with ESMTP id h8EH3FED000818;
	Sun, 14 Sep 2003 21:03:15 +0400 (MSD)
	(envelope-from spartak@corwin.aif.ru)
Received: (from spartak@localhost)
	by corwin.aif.ru (8.12.9/8.12.9/Submit) id h8EH3EWv000817;
	Sun, 14 Sep 2003 21:03:14 +0400 (MSD)
	(envelope-from spartak)
Message-Id: <200309141703.h8EH3EWv000817@corwin.aif.ru>
Date: Sun, 14 Sep 2003 21:03:14 +0400 (MSD)
From: Spartak Radchenko <spartak@aif.ru>
Reply-To: Spartak Radchenko <spartak@aif.ru>
To: FreeBSD-gnats-submit@freebsd.org
Cc: re@freebsd.org, stable@freebsd.org
Subject: dd can't write variable length data blocks to SCSI DDS streamer.
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         56871
>Category:       kern
>Synopsis:       dd can't write variable length data blocks to SCSI DDS streamer.
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-scsi
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Sep 14 10:10:16 PDT 2003
>Closed-Date:    Mon Mar 21 06:57:19 GMT 2005
>Last-Modified:  Mon Mar 21 06:57:19 GMT 2005
>Originator:     Spartak Radchenko
>Release:        FreeBSD 4.9-PRERELEASE i386
>Organization:
Arguments & Facts Weekly
>Environment:
System: FreeBSD corwin.aif.ru 4.9-PRERELEASE FreeBSD 4.9-PRERELEASE #0: Sun Sep 14 18:44:54 MSD 2003 spartak@corwin.aif.ru:/usr/obj/usr/src/sys/corwin i386
>Description:

dd can't write the last short data block to SCSI DDS streamer.
Moreover, it can't write variable length records, only in multiples of 1024.
This problem was introduced in RELENG_4 between Aug 14 and Sep 10 2003.

>How-To-Repeat:

	corwin# dd if=/dev/zero ibs=1024 count=1 obs=1024 of=/dev/sa0
	1+0 records in
	1+0 records out
	1024 bytes transferred in 0.001765 secs (580166 bytes/sec)
	corwin#

1024 bytes are written, all OK.

	corwin# dd if=/dev/zero ibs=1025 count=1 obs=1024 of=/dev/sa0
	dd: /dev/sa0: Invalid argument
	1+0 records in
	1+0 records out
	1024 bytes transferred in 0.004238 secs (241623 bytes/sec)
	corwin#

The last byte from 1025 is lost. There is a message in /var/log/messages:

Sep 14 20:39:52 corwin /kernel: (sa0:ahd1:0:0:0): Invalid request.
Fixed block device requests must be a multiple of 1024 bytes

>Fix:
I don't know the fix for this problem. In some cases a simple workaround
can be used: dd if=... of=/dev/sa0 obs=1024 conv=osync

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: linimon 
State-Changed-When: Thu Aug 26 20:26:27 GMT 2004 
State-Changed-Why:  
Is this still a problem with recent versions of FreeBSD? 


Responsible-Changed-From-To: freebsd-bugs->freebsd-scsi 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Thu Aug 26 20:26:27 GMT 2004 
Responsible-Changed-Why:  
Reassign to appropriate mailing list. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=56871 
State-Changed-From-To: feedback->closed 
State-Changed-By: linimon 
State-Changed-When: Mon Mar 21 06:57:03 GMT 2005 
State-Changed-Why:  
Feedback timeout (> 6 months). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=56871 
>Unformatted:
