Skip to contentSkip to conversation

remove error message on illegal ioctl

PATCH In review Robert Love 3 participants 4 messages Dec 14, 2002 – Dec 16, 2002 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 remove error message on illegal ioctl

This error message is uber annoying and needs to go. Non-root can flood the console with this junk on invalid SCSI CD-ROM ioctl(), and that is exactly what gnome-cd does.

An illegal ioctl() returns an error to the program. That is sufficient - we do not need KERN_ERROR warnings all over the place. Especially when any user can cause them at any rate.

This patch, against 2.5.51, removes the message. Linus, please apply.

Robert Love

 drivers/scsi/sr_ioctl.c |    3 ---
 1 files changed, 3 deletions(-)
drivers/scsi/sr_ioctl.c +0 -3
diff -urN linux-2.5.51/drivers/scsi/sr_ioctl.c linux/drivers/scsi/sr_ioctl.c
@@ -156,9 +156,6 @@
 			err = -ENOMEDIUM;
 			break;
 		case ILLEGAL_REQUEST:
-			if (!cgc->quiet)
-				printk(KERN_ERR "%s: CDROM (ioctl) reports ILLEGAL "
-				       "REQUEST.\n", cd->cdi.name);
 			err = -EIO;
 			if (SRpnt->sr_sense_buffer[12] == 0x20 &&
 			    SRpnt->sr_sense_buffer[13] == 0x00)
#1 lore raw
Quoted 10 lines · Robert Love

This error message is uber annoying and needs to go. Non-root can flood the console with this junk on invalid SCSI CD-ROM ioctl(), and that is exactly what gnome-cd does.

An illegal ioctl() returns an error to the program. That is sufficient - we do not need KERN_ERROR warnings all over the place. Especially when any user can cause them at any rate.

This patch, against 2.5.51, removes the message. Linus, please apply.

Vetoed. That particular function is also used for generic command passed down from the uniform cdrom layer, and it's indeed very handy to see errors if they occur from there.

Your non-root user still has to be able to open the cdrom.

Signature · 1 line
Jens Axboe
#2 lore raw
Quoted 2 lines · Jens Axboe

Your non-root user still has to be able to open the cdrom.

Why not just make this all use the "quiet" flag, and make the ioctl's always set it. That's what it's there for.

Linus

#3 lore raw
Quoted 8 lines · Linus Torvalds
Quoted 2 lines · Jens Axboe

Your non-root user still has to be able to open the cdrom.

Why not just make this all use the "quiet" flag, and make the ioctl's always set it. That's what it's there for.

Yes that would be fine. I just don't want uniform packets to be silently dropped, that makes debugging a problem with a drive pretty much impossible.

Signature · 1 line
Jens Axboe