Date: Thu, 15 May 2008 03:39:35 GMT From: Carlos Santos <unixmania@gmail.com> To: freebsd-gnats-submit@FreeBSD.org Subject: bin/123693: Workaround for burncd: ioctl(CDIOCEJECT): Input/output error Message-ID: <200805150339.m4F3dZ7B077296@www.freebsd.org> Resent-Message-ID: <200805150350.m4F3o2Gc095068@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 123693 >Category: bin >Synopsis: Workaround for burncd: ioctl(CDIOCEJECT): Input/output error >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu May 15 03:50:02 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Carlos Santos >Release: 7.0-STABLE >Organization: - >Environment: FreeBSD casantos 7.0-STABLE FreeBSD 7.0-STABLE #1: Fri Apr 25 03:02:38 BRT 2008 root@casantos:/share/FreeBSD/src/sys/i386/compile/HP_NX6320 i386 >Description: I get "burncd: ioctl(CDIOCEJECT): Input/output error" each time I attempt to blank a CDRW with burncd -f /dev/acd0 blank eject I noticed that this does not happen when I write a data cd with burncd -f /dev/acd0 data cd-image.iso fixate eject I have seen the same bahavior on 4 different computers that have DVD-RW units. It seems that it is necessary to give some time to the writer in order to let it stabilize before attempting to eject the disk. >How-To-Repeat: Run "burncd -f /dev/acd0 blank eject" on a Compaq nx6320 notebook with FreeBSD 7.0-STABLE installed. I have seen the same problem on 6.x releases. >Fix: Applying the attached patch to /usr/src/usr.sbin/burncd/burncd.c solves the problem. It makes burncd attempt to eject the CD five times, sleeping for one second after each unccessful try. Patch attached with submission follows: --- burncd.c.orig 2005-05-13 17:06:44.000000000 -0300 +++ burncd.c 2008-05-12 01:44:30.000000000 -0300 @@ -46,6 +46,7 @@ #include <arpa/inet.h> #define BLOCKS 16 +#define EJECT_TRIES 5 struct track_info { int file; @@ -316,9 +317,13 @@ err(EX_IOERR, "ioctl(CDRIOCSETBLOCKSIZE)"); } - if (eject) - if (ioctl(fd, CDIOCEJECT) < 0) + if (eject) { + int status, i = 0; + while ((status = ioctl(fd, CDIOCEJECT)) < 0 && ++i <= EJECT_TRIES) + sleep(1); + if (status < 0) err(EX_IOERR, "ioctl(CDIOCEJECT)"); + } close(fd); exit(EX_OK); } >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200805150339.m4F3dZ7B077296>