[Debburn-devel] libusal patch

Arno Willig akw at thinkwiki.org
Mon Feb 26 13:32:36 CET 2007


Dear list!

I am new to this list and would like to introduce myself first:
My name is Arno Willig, I am a software developer and my company works a
lot with cdrecord/wodim.
We noticed the following problem:
When  running wodim scsi device get exclusively locked.
In the function usalo_open the devices get scanned. During the scan
usalo_open tries to open the devices using sg_open_excl. The problem is,
that the scan is aborted when a device canned be opened because it is
locked by another instance of wodim.
So higher device numbers are not recognized.

So, you cannot run multiple instances of wodim at the same time, which
is required by my company.

This easy patch fixes this wrong behavior for /dev/sgX devices:

Index: libusal/scsi-linux-sg.c
===================================================================
--- libusal/scsi-linux-sg.c     (Revision 705)
+++ libusal/scsi-linux-sg.c     (Arbeitskopie)
@@ -458,7 +458,7 @@
                                if (usalp->errstr)
                                        snprintf(usalp->errstr,
SCSI_ERRSTR_SIZE,
                                                        "Cannot open
'%s'", devname);
-                               if(errno == EACCES || errno==EPERM)
+                               if(errno == EACCES || errno==EPERM ||
errno == EBUSY)
                                        continue;
                                if (errno != ENOENT && errno != ENXIO &&
errno != ENODEV) {
                                        if (usalp->errstr)




Please recheck and commit this patch to the subversion repository.


Thank you very much,

Arno Willig
akw at thinkwiki.org



-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch-continue-scan-on-busy.patch
Type: text/x-patch
Size: 521 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/debburn-devel/attachments/20070226/abda7705/patch-continue-scan-on-busy.bin


More information about the Debburn-devel mailing list