pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/41043: brasero-2.26.0's scsi-netbsd driver does not work



>Number:         41043
>Category:       pkg
>Synopsis:       brasero-2.26.0's scsi-netbsd driver does not work
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Mar 19 15:50:00 +0000 2009
>Originator:     Jared D. McNeill
>Release:        NetBSD 5.99.7
>Organization:
        
>Environment:
        
        
System: NetBSD black.invisible.ca 5.99.7 NetBSD 5.99.7 (GENERIC) #75: Mon Mar 9 
08:19:45 EDT 2009 
jmcneill%black.invisible.ca@localhost:/export/home/jmcneill/branches/HEAD/src/sys/arch/amd64/compile/GENERIC
 amd64
Architecture: x86_64
Machine: amd64
>Description:

When trying to burn a CD with brasero-2.26.0, the scsi-netbsd driver 
continually fails with:

(brasero:25684): BraseroMedia-DEBUG: At brasero-drive.c:831: Contents changed
(brasero:25684): BraseroMedia-DEBUG: At brasero-drive.c:846: Medium inserted
(brasero:25684): BraseroMedia-DEBUG: At brasero-medium.c:2967: Trying to open 
device /dev/cd0d
(brasero:25684): BraseroMedia-DEBUG: At brasero-medium.c:2988: Open () succeeded
(brasero:25684): BraseroMedia-DEBUG: At scsi-netbsd.c:116: SCSI command error: 
Invalid argument
(brasero:25684): BraseroMedia-DEBUG: At scsi-netbsd.c:116: SCSI command error: 
Invalid argument
(brasero:25684): BraseroMedia-DEBUG: At scsi-netbsd.c:116: SCSI command error: 
Invalid argument
(brasero:25684): BraseroMedia-DEBUG: At scsi-netbsd.c:116: SCSI command error: 
Invalid argument
(brasero:25684): BraseroMedia-DEBUG: At scsi-netbsd.c:116: SCSI command error: 
Invalid argument
[...]

EINVAL is coming from scsipi because scsireq->timeout == 0. Brasero should also 
communicate with /dev/rcd0d instead of /dev/cd0d, so the attached patch fixes 
that as well.

>How-To-Repeat:
        
>Fix:

Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/sysutils/brasero/Makefile,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 Makefile
--- Makefile    16 Mar 2009 10:49:06 -0000      1.1.1.1
+++ Makefile    19 Mar 2009 15:42:44 -0000
@@ -2,6 +2,7 @@
 #
 
 DISTNAME=      brasero-2.26.0
+PKGREVISION=   1
 CATEGORIES=    sysutils gnome
 MASTER_SITES=  ${MASTER_SITE_GNOME:=sources/brasero/2.26/}
 EXTRACT_SUFX=  .tar.bz2
Index: files/scsi-netbsd.c
===================================================================
RCS file: /cvsroot/pkgsrc/sysutils/brasero/files/scsi-netbsd.c,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 scsi-netbsd.c
--- files/scsi-netbsd.c 16 Mar 2009 10:49:06 -0000      1.1.1.1
+++ files/scsi-netbsd.c 19 Mar 2009 15:42:44 -0000
@@ -67,7 +67,8 @@ typedef struct _BraseroScsiCmd BraseroSc
 #define BRASERO_SCSI_CMD_OPCODE_OFF                    0
 #define BRASERO_SCSI_CMD_SET_OPCODE(command)           (command->cmd 
[BRASERO_SCSI_CMD_OPCODE_OFF] = command->info->opcode)
 
-#define OPEN_FLAGS                     O_RDWR /*|O_EXCL */|O_NONBLOCK
+#define OPEN_FLAGS                     (O_RDWR|O_NONBLOCK)
+#define SCSIREQ_TIMEOUT                        (30 * 1000)
 
 /**
  * This is to send a command
@@ -85,6 +86,7 @@ brasero_sg_command_setup (scsireq_t *req
        memcpy(req->cmd, cmd->cmd, req->cmdlen);
        req->databuf = buffer;
        req->datalen = size;
+       req->timeout = SCSIREQ_TIMEOUT;
 
        /* where to output the scsi sense buffer */
        req->senselen = BRASERO_SENSE_DATA_SIZE;
@@ -112,7 +114,7 @@ brasero_scsi_command_issue_sync (gpointe
                                  size);
 
        res = ioctl (cmd->handle->fd, SCIOCCOMMAND, &req);
-       if (res) {
+       if (res == -1) {
                BRASERO_SCSI_SET_ERRCODE (error, BRASERO_SCSI_ERRNO);
                return BRASERO_SCSI_FAILURE;
        }
@@ -162,11 +164,14 @@ brasero_device_handle_open (const gchar 
        int fd;
        int flags = OPEN_FLAGS;
        BraseroDeviceHandle *handle;
+       gchar *rdevnode;
 
        if (exclusive)
                flags |= O_EXCL;
 
-       fd = open (path, flags);
+       rdevnode = g_strdup_printf ("/dev/r%s", path + strlen ("/dev/"));
+       fd = open (rdevnode, flags);
+       g_free (rdevnode);
        if (fd < 0) {
                if (code) {
                        if (errno == EAGAIN

>Unformatted:
        
        


Home | Main Index | Thread Index | Old Index