Subject: kern/6573: Move/Exchange operations exceeding device caps should return ENODEV
To: None <gnats-bugs@gnats.netbsd.org>
From: Justin T. Gibbs <gibbs@netbsd.org>
List: netbsd-bugs
Date: 12/12/1998 16:01:33
>Number: 6573
>Category: kern
>Synopsis: Move/Exchange operations exceeding device caps should return ENODEV
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: kern-bug-people (Kernel Bug People)
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat Dec 12 16:05:01 1998
>Last-Modified:
>Originator: Justin T. Gibbs
>Organization:
--
Justin Gibbs
>Release: NetBSD-current 19981212
>Environment:
System: NetBSD nb00 1.3I NetBSD 1.3I (ZHADUM) #13: Wed Dec 2 18:24:54 PST 1998 root@:/ccd0/src/sys/arch/i386/compile/ZHADUM i386
>Description:
If an exchange or move operation request exceeds the capabilites
of the target changer device (from the device caps page), EINVAL
is returned instead of ENODEV.
>How-To-Repeat:
chio echange slot 1 slot 2 on a device that does not support
exchange operations.
>Fix:
Index: ch.c
===================================================================
RCS file: /cvsroot/src/sys/dev/scsipi/ch.c,v
retrieving revision 1.36
diff -c -r1.36 ch.c
*** ch.c 1998/12/08 00:19:56 1.36
--- ch.c 1998/12/12 23:56:34
***************
*** 383,389 ****
* Check the request against the changer's capabilities.
*/
if ((sc->sc_movemask[cm->cm_fromtype] & (1 << cm->cm_totype)) == 0)
! return (EINVAL);
/*
* Calculate the source and destination elements.
--- 383,389 ----
* Check the request against the changer's capabilities.
*/
if ((sc->sc_movemask[cm->cm_fromtype] & (1 << cm->cm_totype)) == 0)
! return (ENODEV);
/*
* Calculate the source and destination elements.
***************
*** 436,442 ****
(1 << ce->ce_fdsttype)) == 0) ||
((sc->sc_exchangemask[ce->ce_fdsttype] &
(1 << ce->ce_sdsttype)) == 0))
! return (EINVAL);
/*
* Calculate the source and destination elements.
--- 436,442 ----
(1 << ce->ce_fdsttype)) == 0) ||
((sc->sc_exchangemask[ce->ce_fdsttype] &
(1 << ce->ce_sdsttype)) == 0))
! return (ENODEV);
/*
* Calculate the source and destination elements.
>Audit-Trail:
>Unformatted: