Bug 135943 - remove or limit "Using deprecated /dev/sg mechanism instead of SG_IO on the actual device" messages
remove or limit "Using deprecated /dev/sg mechanism instead of SG_IO on the a...
Status: CLOSED RAWHIDE
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: kernel (Show other bugs)
4.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Doug Ledford
Brian Brock
:
Depends On:
Blocks: 135876
  Show dependency treegraph
 
Reported: 2004-10-15 16:29 EDT by Matt Domsch
Modified: 2007-11-30 17:07 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-11-18 06:12:06 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Matt Domsch 2004-10-15 16:29:19 EDT
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 16:31:37 EDT
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 16:31:28 EST
Doug, can we expect this to be fixed for RHEL4 RC please?
Comment 5 Tim Burke 2004-11-15 20:41:16 EST
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 06:12:06 EST
Removal confirmed with 2.6.9-1.730_EL.
Comment 7 Amit Bhutani 2004-11-23 18:52:13 EST
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.