public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] st.c for GET_IDLUN 2.6.6-rc2
@ 2004-04-25  8:40 Douglas Gilbert
  2004-04-25  9:06 ` Kai Makisara
  0 siblings, 1 reply; 6+ messages in thread
From: Douglas Gilbert @ 2004-04-25  8:40 UTC (permalink / raw)
  To: Kai.Makisara; +Cc: osst, linux-scsi

[-- Attachment #1: Type: text/plain, Size: 493 bytes --]

Kai,
A little more testing of st's SG_IO ioctl turned up a
small problem.

This is the corresponding patch that was applied to the
sd driver when it received the block layer SG_IO ioctl.

For least surprise of lk 2.4 utilities that use the
SCSI_IOCTL_GET_IDLUN and SCSI_IOCTL_GET_BUS_NUMBER
ioctls (e.g. sg_map) it is better to return the correct
values rather than 0.

BTW Does cdrecord correctly distinguish between 2
(non-scsi) ATAPI cd writers on the same system in
lk 2.6 ?

Doug Gilbert

[-- Attachment #2: st266rc2.diff --]
[-- Type: text/plain, Size: 629 bytes --]

--- linux/drivers/scsi/st.c	2004-04-05 20:49:34.000000000 +1000
+++ linux/drivers/scsi/st.c266rc2id	2004-04-25 18:13:50.272071680 +1000
@@ -3402,11 +3402,17 @@
 		goto out;
 	}
 	up(&STp->lock);
-	i = scsi_cmd_ioctl(STp->disk, cmd_in, arg);
-	if (i != -ENOTTY)
-		return i;
-	else
-		return scsi_ioctl(STp->device, cmd_in, (void *) arg);
+	switch (cmd_in) {
+		case SCSI_IOCTL_GET_IDLUN:
+		case SCSI_IOCTL_GET_BUS_NUMBER:
+			break;
+		default:
+			i = scsi_cmd_ioctl(STp->disk, cmd_in, arg);
+			if (i != -ENOTTY)
+				return i;
+			break;
+	}
+	return scsi_ioctl(STp->device, cmd_in, (void *) arg);
 
  out:
 	up(&STp->lock);

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-04-28 15:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-25  8:40 [PATCH] st.c for GET_IDLUN 2.6.6-rc2 Douglas Gilbert
2004-04-25  9:06 ` Kai Makisara
2004-04-26  0:48   ` Douglas Gilbert
2004-04-26 16:12     ` Kai Makisara
2004-04-28  3:42       ` Douglas Gilbert
2004-04-28 15:21         ` Kai Makisara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox