From nobody@FreeBSD.org  Wed Jan 10 05:51:34 2001
Return-Path: <nobody@FreeBSD.org>
Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21])
	by hub.freebsd.org (Postfix) with ESMTP id 5398137B402
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 10 Jan 2001 05:51:34 -0800 (PST)
Received: (from nobody@localhost)
	by freefall.freebsd.org (8.11.1/8.11.1) id f0ADpYj60679;
	Wed, 10 Jan 2001 05:51:34 -0800 (PST)
	(envelope-from nobody)
Message-Id: <200101101351.f0ADpYj60679@freefall.freebsd.org>
Date: Wed, 10 Jan 2001 05:51:34 -0800 (PST)
From: Jean-Francois Dockes <jean-francois.dockes@wanadoo.fr>
To: freebsd-gnats-submit@FreeBSD.org
Subject: mt_resid not updated by scsi_sa.c
X-Send-Pr-Version: www-1.0

>Number:         24221
>Category:       kern
>Synopsis:       mt_resid not updated by scsi_sa.c
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    mjacob
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jan 10 06:00:00 PST 2001
>Closed-Date:    Mon Jan 22 10:15:29 PST 2001
>Last-Modified:  Mon Jan 22 10:15:54 PST 2001
>Originator:     Jean-Francois Dockes
>Release:        4.2-STABLE
>Organization:
>Environment:
FreeBSD mouton 4.2-STABLE FreeBSD 4.2-STABLE #0: Fri Dec  1 21:47:38 CET 2000     dockes@mouton:/usr/obj/hautmedoc/u/src/sys/HAUTMEDOC  i386

>Description:
mt_resid is not returned by ioctl MTIOCGET. While the value is 
accessible through ioctl MTIOCERRSTAT, the latter is not portable.
This is not a big issues for read() calls, but is ennoying for MTIOCTOP
operations like fsr, fsf, etc...



>How-To-Repeat:

>Fix:
Update the mt_resid field,in MTIOCGET using the values from last_ctl_resid or
last_io_resid. This supposes that it's remembered somewhere which was
updated last.


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->mjacob 
Responsible-Changed-By: mjacob 
Responsible-Changed-When: Wed Jan 10 11:27:32 PST 2001 
Responsible-Changed-Why:  

http://www.freebsd.org/cgi/query-pr.cgi?pr=24221 

From: Matthew Jacob <mjacob@feral.com>
To: Jean-Francois Dockes <jean-francois.dockes@wanadoo.fr>
Cc: freebsd-gnats-submit@FreeBSD.ORG
Subject: Re: kern/24221: mt_resid not updated by scsi_sa.c
Date: Mon, 15 Jan 2001 14:43:07 -0800 (PST)

 This was actually on purpose. The reason mt_resid is not being updated
 is a 'short' is not big enough. I suppose one could make the argument
 that you could change it to u_int16_t (which wouldn't change the size of
 the struct) and this would serve for the current default 64KB physical
 raw i/o blocksize limit. Then, if you get a resid to large, it can overflow.
 I'd rather not have people depend on it at all in that case.
 
 I suppose I could change the size in -current, but I can't backport it to 4.2.
 I'm not even sure I should do it even in -current because this has implications
 for the rmt protocols.
 
 Your point about non-portability has *some* merit- but not too much. The
 structure has no POSIX existence- but has become this sort of almost kind
 of expected standard.
 
 Given what I said above, what would you like?
 
 
 
 Jean-Francois Dockes <jean-francois.dockes@wanadoo.fr> wrote:
 
 > 
 > >Number:         24221
 > >Category:       kern
 > >Synopsis:       mt_resid not updated by scsi_sa.c
 > >Confidential:   no
 > >Severity:       serious
 > >Priority:       low
 > >Responsible:    freebsd-bugs
 > >State:          open
 > >Quarter:        
 > >Keywords:       
 > >Date-Required:
 > >Class:          sw-bug
 > >Submitter-Id:   current-users
 > >Arrival-Date:   Wed Jan 10 06:00:00 PST 2001
 > >Closed-Date:
 > >Last-Modified:
 > >Originator:     Jean-Francois Dockes
 > >Release:        4.2-STABLE
 > >Organization:
 > >Environment:
 > FreeBSD mouton 4.2-STABLE FreeBSD 4.2-STABLE #0: Fri Dec  1 21:47:38 CET 2000     dockes@mouton:/usr/obj/hautmedoc/u/src/sys/HAUTMEDOC  i386
 > 
 > >Description:
 > mt_resid is not returned by ioctl MTIOCGET. While the value is 
 > accessible through ioctl MTIOCERRSTAT, the latter is not portable.
 > This is not a big issues for read() calls, but is ennoying for MTIOCTOP
 > operations like fsr, fsf, etc...
 > 
 > 
 > 
 > >How-To-Repeat:
 > 
 > >Fix:
 > Update the mt_resid field,in MTIOCGET using the values from last_ctl_resid or
 > last_io_resid. This supposes that it's remembered somewhere which was
 > updated last.
 > 
 > 
 > >Release-Note:
 > >Audit-Trail:
 > >Unformatted:
 > 
 > 
 > To Unsubscribe: send mail to majordomo@FreeBSD.org
 > with "unsubscribe freebsd-bugs" in the body of the message
 > 
 
 
 
State-Changed-From-To: open->feedback 
State-Changed-By: mjacob 
State-Changed-When: Mon Jan 15 23:27:30 PST 2001 
State-Changed-Why:  
Waiting for feedback fom submitter. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=24221 
State-Changed-From-To: feedback->closed 
State-Changed-By: mjacob 
State-Changed-When: Mon Jan 22 10:15:29 PST 2001 
State-Changed-Why:  
mt_resid is now updated. Even if it overflows. 

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