linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2.6.20-rc3] fix broken retval test in sr_block_ioctl
@ 2007-01-02 22:24 Mark Lord
  2007-01-02 22:32 ` Jeff Garzik
  0 siblings, 1 reply; 3+ messages in thread
From: Mark Lord @ 2007-01-02 22:24 UTC (permalink / raw)
  To: Tejun Heo, Jeff Garzik, IDE/ATA development list, linux-scsi

With recent kernels (and possibly much older ones, too),
ioctl() calls for ATAPI devices never make it to the driver layers.

The reason for this is a borked return code test in drivers/scsi/sr.c.
This patch fixes it.

Signed-off-by:  Mark Lord <mlord@pobox.com>

---
--- old/drivers/scsi/sr.c	2006-11-29 16:57:37.000000000 -0500
+++ linux/drivers/scsi/sr.c	2007-01-02 16:40:33.000000000 -0500
@@ -468,7 +468,7 @@
 	}
 
 	ret = cdrom_ioctl(file, &cd->cdi, inode, cmd, arg);
-	if (ret != ENOSYS)
+	if (ret != -ENOSYS)
 		return ret;
 
 	/*

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

* Re: [PATCH 2.6.20-rc3] fix broken retval test in sr_block_ioctl
  2007-01-02 22:24 [PATCH 2.6.20-rc3] fix broken retval test in sr_block_ioctl Mark Lord
@ 2007-01-02 22:32 ` Jeff Garzik
  2007-01-02 22:39   ` Mark Lord
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff Garzik @ 2007-01-02 22:32 UTC (permalink / raw)
  To: Mark Lord; +Cc: Tejun Heo, IDE/ATA development list, linux-scsi

Mark Lord wrote:
> With recent kernels (and possibly much older ones, too),
> ioctl() calls for ATAPI devices never make it to the driver layers.
> 
> The reason for this is a borked return code test in drivers/scsi/sr.c.
> This patch fixes it.
> 
> Signed-off-by:  Mark Lord <mlord@pobox.com>
> 
> ---
> --- old/drivers/scsi/sr.c	2006-11-29 16:57:37.000000000 -0500
> +++ linux/drivers/scsi/sr.c	2007-01-02 16:40:33.000000000 -0500
> @@ -468,7 +468,7 @@
>  	}
>  
>  	ret = cdrom_ioctl(file, &cd->cdi, inode, cmd, arg);
> -	if (ret != ENOSYS)
> +	if (ret != -ENOSYS)

I think Tejun posted the same patch earlier today.

ACK to either patch, of course.

	Jeff




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

* Re: [PATCH 2.6.20-rc3] fix broken retval test in sr_block_ioctl
  2007-01-02 22:32 ` Jeff Garzik
@ 2007-01-02 22:39   ` Mark Lord
  0 siblings, 0 replies; 3+ messages in thread
From: Mark Lord @ 2007-01-02 22:39 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: Tejun Heo, IDE/ATA development list, linux-scsi

Jeff Garzik wrote:
> Mark Lord wrote:
...
>>      ret = cdrom_ioctl(file, &cd->cdi, inode, cmd, arg);
>> -    if (ret != ENOSYS)
>> +    if (ret != -ENOSYS)
> 
> I think Tejun posted the same patch earlier today.

Ahh.. missed it -- could have saved me an hour or two of debugging!

Cheers!


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

end of thread, other threads:[~2007-01-02 22:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-02 22:24 [PATCH 2.6.20-rc3] fix broken retval test in sr_block_ioctl Mark Lord
2007-01-02 22:32 ` Jeff Garzik
2007-01-02 22:39   ` Mark Lord

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).