From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kay Sievers Date: Thu, 08 Sep 2005 19:18:34 +0000 Subject: Re: cdrom_id (udev) causes "No disk in drive" warning for ide devices with removable media Message-Id: <20050908191834.GA2430@vrfy.org> MIME-Version: 1 Content-Type: multipart/mixed; boundary="Kj7319i9nmIyA2yE" List-Id: References: <200509081443.29756.thomasheinz@gmx.net> In-Reply-To: <200509081443.29756.thomasheinz@gmx.net> To: linux-hotplug@vger.kernel.org --Kj7319i9nmIyA2yE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Sep 08, 2005 at 05:38:22PM +0200, Thomas Heinz wrote: > Unfortunately, a similar problem occurs with my SCSI CD-RW drive. It is > caused by the rule: > > BUS=="scsi", KERNEL="sr[0-9]*", ACTION=="add", IMPORT="/sbin/cdrom_id > --export $tempnode" > > Now in this case, it is really about a "cdrom". The message seems to be > from drivers/scsi/scsi_ioctl.c. Interestingly, my other SCSI "cdrom" (in > fact a DVD-RAM drive) does not cause such a warning. > > What is your suggestion? Can you try this patch? Only a wild guess that it may help... Kay --Kj7319i9nmIyA2yE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename="cdrom_id-01.patch" diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c --- a/extras/cdrom_id/cdrom_id.c +++ b/extras/cdrom_id/cdrom_id.c @@ -36,6 +36,8 @@ * with all of the DVD flags. So we just include our own, aren't * we so nice... */ +#define CDO_USE_FFLAGS 0x4 /* use O_NONBLOCK information on open */ +#define CDROM_SET_OPTIONS 0x5320 /* Set behavior options */ #define CDROM_GET_CAPABILITY 0x5331 /* get capabilities */ /* capability flags used with the uniform CD-ROM driver */ @@ -115,14 +117,21 @@ int main(int argc, char *argv[]) fd = open(node, O_RDONLY|O_NONBLOCK); if (fd < 0) { info("unable to open '%s'", node); - rc = 1; + rc = 2; goto exit; } + result = ioctl(fd, CDROM_SET_OPTIONS, CDO_USE_FFLAGS); + if (result < 0) { + info("CDROM_SET_OPTIONS failed for '%s'", node); + rc = 3; + goto close; + } + result = ioctl(fd, CDROM_GET_CAPABILITY, NULL); if (result < 0) { info("CDROM_GET_CAPABILITY failed for '%s'", node); - rc = 3; + rc = 4; goto close; } --Kj7319i9nmIyA2yE-- ------------------------------------------------------- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel