Bug 135943 - remove or limit "Using deprecated /dev/sg mechanism instead of SG_IO on the actual device" messages
Summary: remove or limit "Using deprecated /dev/sg mechanism instead of SG_IO on the a...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: kernel
Version: 4.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Doug Ledford
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks: 135876
TreeView+ depends on / blocked
 
Reported: 2004-10-15 20:29 UTC by Matt Domsch
Modified: 2007-11-30 22:07 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-11-18 11:12:06 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Matt Domsch 2004-10-15 20:29:19 UTC
Description of problem:
The following hunk from SOURCES/linux-2.6.0-compile.patch causes a 
huge number (thousands depending on number of disks in the system, 
repeatedly over time) of messages to be spewn to the console by tools 
such as Dell OpenManage Storage Administrator due to its (ab)use 
of /dev/sg to detect devices.  Please remove this hunk, it's also not 
included upstream, or re-architect it to spew far less often (once 
per open is still way too often for the same app).

--- linux-1130/drivers/scsi/sg.c
+++ linux-10000/drivers/scsi/sg.c
@@ -241,6 +241,12 @@ sg_open(struct inode *inode, struct file
                return -ENXIO;
        if (sdp->detached)
                return -ENODEV;
+
+       /* scsi generic is only for non-disk, non-cd, non-tape 
devices */
+       if ( (sdp->device->type == TYPE_DISK) || (sdp->device->type 
== TYPE_MOD) || (sdp->device->type == TYPE_ROM)
+          || (sdp->device->type == TYPE_WORM) || ( sdp->device->type 
== TYPE_TAPE))
+               printk(KERN_WARNING "%s: Using deprecated /dev/sg 
mechanism instead of SG_IO on the actual device\n",current\
->comm);
+

        /* This driver's module count bumped by fops_get in 
<linux/fs.h> */
        /* Prevent the device driver from vanishing while we sleep */
d

Version-Release number of selected component (if applicable):
kernel-2.6.8-1.624.src.rpm

How reproducible:
always by any app (such as ploink.c given to Doug Ledford to debug a 
RHEL3 SCSI race condition between various actions (add/remove/open) 
on SCSI devices.

Steps to Reproduce:
1. Run something that opens /dev/sg* repeatedly
2. 
3.
  
Actual results:
kernel spews to the console

Expected results:
kernel warns once or occasionally at KERN_DEBUG level, not constantly 
due to app constantly calling open(/dev/sg).

Additional info:

Comment 1 Matt Domsch 2004-10-15 20:31:37 UTC
Note, the above patch is provided by Red Hat only, it has not been 
included upstream.  While you can argue that the app should change to 
not use /dev/sg, forcing all apps to do so to avoid clogging the 
system with these messages will limit third party app availability on 
RHEL4.  Dell OpenManage apps currently plan on using the RHEL2.1 and 
RHEL3 compatibility promised by RHEL4 marketing to have their apps 
ready within a year of RHEL4 launch.

Comment 4 Matt Domsch 2004-11-10 21:31:28 UTC
Doug, can we expect this to be fixed for RHEL4 RC please?

Comment 5 Tim Burke 2004-11-16 01:41:16 UTC
Setting state to modified per status from Doug:

This one is done (although not by me, as it turns out this message was a
Red Hat added message and we just removed it).

Comment 6 Jay Turner 2004-11-18 11:12:06 UTC
Removal confirmed with 2.6.9-1.730_EL.

Comment 7 Amit Bhutani 2004-11-23 23:52:13 UTC
Verified via code inspection that this has been fixed in kernel 2.6.9-
1.751_EL. The printk KERN_WARNING message has been removed. Thanks. 

Removing from internal RC Blocker list. Sue: Please do the same from 
your list.



Note You need to log in before you can comment on or make changes to this bug.