growisofs broken with 2.6.8.1

Bug #7825 reported by Debian Bug Importer
18
Affects Status Importance Assigned to Milestone
linux-source-2.6.15 (Debian)
Fix Released
Unknown
linux-source-2.6.15 (Ubuntu)
Fix Released
High
LaMont Jones

Bug Description

Automatically imported from Debian bug report #270437 http://bugs.debian.org/270437

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Automatically imported from Debian bug report #270437 http://bugs.debian.org/270437

Revision history for this message
Debian Bug Importer (debzilla) wrote :
Download full text (3.3 KiB)

Message-Id: <email address hidden>
Date: Tue, 7 Sep 2004 14:07:17 +0200
From: Hendrik Naumann <email address hidden>
To: <email address hidden>
Subject: kernel-image-2.6.8-1-686: dvd+rw-tools in testing broken

=2D----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Package: kernel-image-2.6.8-1-686
Version: 2.6.8-2
Severity: critical
Justification: breaks unrelated software

With kernel-image-2.6.8-1-686 /usr/bin/growisofs from=20
dvd+rw-tools packages does not work anymore with my dvd-burner.=20

With kernel-image-2.6.7-1-686 it works perfect.

See bug #269397 for more details.

If you need I can supply dmesg from both kernel-image-2.6.7-1-686=20
and kernel-image-2.6.8-1-686.

Both kernels give the same entry for initializing the ide controler

Sep 7 13:10:19 hendrik kernel: ICH5: IDE controller at PCI slot 0000:00:1f=
=2E1
Sep 7 13:10:19 hendrik kernel: ACPI: PCI interrupt 0000:00:1f.1[A] -> GSI =
18 (level, low) -> IRQ 185
Sep 7 13:10:19 hendrik kernel: ICH5: chipset revision 2
Sep 7 13:10:19 hendrik kernel: ICH5: not 100%% native mode: will probe irq=
s later
Sep 7 13:10:19 hendrik kernel: ide0: BM-DMA at 0x2400-0x2407, BIOS set=
tings: hda:DMA, hdb:DMA
Sep 7 13:10:19 hendrik kernel: ide1: BM-DMA at 0x2408-0x240f, BIOS set=
tings: hdc:pio, hdd:pio
Sep 7 13:10:19 hendrik kernel: hda: WDC WD1200JB-00EVA0, ATA DISK drive
Sep 7 13:10:19 hendrik kernel: hdb: HL-DT-ST DVDRAM GSA-4040B, ATAPI CD/DV=
D-ROM drive
Sep 7 13:10:19 hendrik kernel: Using anticipatory io scheduler
Sep 7 13:10:19 hendrik kernel: ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
Sep 7 13:10:19 hendrik kernel: hda: max request size: 1024KiB
Sep 7 13:10:19 hendrik kernel: hda: 234441648 sectors (120034 MB) w/8192Ki=
B Cache, CHS=3D16383/255/63, UDMA(100)
Sep 7 13:10:19 hendrik kernel: /dev/ide/host0/bus0/target0/lun0: p1 p2 < =
p5 p6 p7 >
Sep 7 13:10:19 hendrik kernel: kjournald starting. Commit interval 5 seco=
nds
Sep 7 13:10:19 hendrik kernel: EXT3-fs: mounted filesystem with ordered da=
ta mode.
Sep 7 13:10:19 hendrik kernel: kjournald starting. Commit interval 5 seco=
nds
Sep 7 13:10:19 hendrik kernel: EXT3-fs: mounted filesystem with ordered da=
ta mode.
Sep 7 13:10:19 hendrik kernel: hdb: ATAPI 63X DVD-ROM DVD-R-RAM CD-R/RW dr=
ive, 2048kB Cache, UDMA(33)
Sep 7 13:10:19 hendrik kernel: Uniform CD-ROM driver Revision: 3.20
Sep 7 13:10:19 hendrik kernel: hdb: drive_cmd: status=3D0x51 { DriveReady =
SeekComplete Error }
Sep 7 13:10:19 hendrik kernel: hdb: drive_cmd: error=3D0x04Aborted Command

=2D -- System Information:
Debian Release: 3.1
  APT prefers testing
  APT policy: (500, 'testing'), (200, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.6.8-1-686
Locale: LANG=3Dde_DE@euro, LC_CTYPE=3Dde_DE@euro (ignored: LC_ALL set to de=
_DE@euro)

Versions of packages kernel-image-2.6.8-1-686 depends on:
ii coreutils [fileutils] 5.2.1-2 The GNU core utilities
ii fileutils 5.2.1-2 The GNU file management utilit=
ies
ii initrd-tools 0.1.71 tools to create initrd image f=
or p
ii module-init-tools 3.1-pre5-3 tools for managing Linux kerne=
l mo

=2D -- no debconf information

=2D --=20
...

Read more...

Revision history for this message
LaMont Jones (lamont) wrote :

with an IDE CDrom burner, there are 2 issues here:
1) kernel bitches (as the submitter indicates), this is not fatal.
2) If the command is not run as root, then I get the error:
       :-( unable to PREVENT MEDIA REMOVAL: Operation not permitted

Of course, since I use sudo to get to root, I have to unset SUDO_COMMAND in
order to actually burn the dvd as root... :-(

Basically, we need to allow non-root to prevent media removal, it would appear,
or make growisofs not consider that fatal...

Revision history for this message
Matt Zimmerman (mdz) wrote :

If true, this seems like a regression in 2.6.8.1.
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=269397 seems to have the actual
bug report

Revision history for this message
Matt Zimmerman (mdz) wrote :

I have USB DVD writer. While writing continues to work for me with 2.6.8.1,
the kernel logs a _flood_ (hundreds per second) of these messages during the
process:

SCSI error : <2 0 0 0> return code = 0x70000

There is no other context, and no errors are returned to the user program
(growisofs).

Revision history for this message
Herbert Xu (herbert-gondor) wrote :

Lamont's problem is already fixed in Debian's 2.6.8-3 and our 2.6.8.1-1.

Revision history for this message
Herbert Xu (herbert-gondor) wrote :

(In reply to comment #4)
>
> SCSI error : <2 0 0 0> return code = 0x70000
>
> There is no other context, and no errors are returned to the user program
> (growisofs).

Sounds like an unrelated USB problem. Please report this bug at
bugzilla.kernel.org and Alan Stern should be able to help you with it.

Revision history for this message
Matt Zimmerman (mdz) wrote :

LaMont, were you not running 2.6.8.1-2?

Revision history for this message
LaMont Jones (lamont) wrote :

% uname -a
Linux mix 2.6.8.1-1-686 #1 Mon Sep 6 19:46:26 UTC 2004 i686 GNU/Linux
% dpkg -l | grep linux-image
ii linux-image-2. 2.6.8.1-2 Linux kernel image for version 2.6.8.1 on PP
% growisofs -Z /dev/hdc ~/zz
WARNING: /dev/hdc already carries isofs!
About to execute 'mkisofs /home/lamont/zz | builtin_dd of=/dev/hdc obs=32k seek=0'
:-( unable to PREVENT MEDIA REMOVAL: Operation not permitted

it's broken here.

Revision history for this message
Matt Zimmerman (mdz) wrote :

The media removal problem is reproducible here as well. Is that the only issue?
   The original submitter said it didn't work as root, either.

"Now, the funny thing here is that neither doing this as root or user
worked"

Therefore, the media removal problem seems like a different bug.

mdz@ubuntu ~ $ !grow
growisofs -Z /dev/sr0=warty-powerpc-1.iso
WARNING: /dev/sr0 already carries isofs!
About to execute 'builtin_dd if=warty-powerpc-1.iso of=/dev/sr0 obs=32k seek=0'
:-( unable to PREVENT MEDIA REMOVAL: Operation not permitted
mdz@ubuntu ~ $ uname -a
Linux ubuntu 2.6.8.1-1-686 #1 Mon Sep 6 19:46:26 UTC 2004 i686 GNU/Linux
mdz@ubuntu ~ $ growisofs -Z /dev/sr0=warty-powerpc-1.iso
WARNING: /dev/sr0 already carries isofs!
About to execute 'builtin_dd if=warty-powerpc-1.iso of=/dev/sr0 obs=32k seek=0'
:-( unable to PREVENT MEDIA REMOVAL: Operation not permitted

Revision history for this message
Herbert Xu (herbert-gondor) wrote :

(In reply to comment #9)
> The media removal problem is reproducible here as well. Is that the only issue?

OK. It's a bug in growisofs. It needs to open the device as read-write.

Revision history for this message
In , Matt Zimmerman (mdz) wrote : Patch

tags 270437 patch
thanks

Herbert Xu pointed out that the problem is that growisofs opens the device
read-only, while read-write mode is necessary for some of the ioctls that it
uses. This trivial patch seems to get it working again, though I confess
the code is difficult to follow and I'm not sure if it has other side
effects.

http://growisofs-has-too-many-gotos.no-name-yet.com/patches/dvd+rw-tools.270437.diff

--
 - mdz

Revision history for this message
Matt Zimmerman (mdz) wrote :

My goodness, this code is a mess. It opens the device in a dozen different
places, with gotos everywhere. I'll see what I can do to get it to open with
the correct mode

Revision history for this message
Matt Zimmerman (mdz) wrote :

 dvd+rw-tools (5.19.4.9.7-2ubuntu2) warty; urgency=low
 .
   * Open the device O_RDWR to do ioctls (Warty #1066, Debian #270437)

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Message-ID: <email address hidden>
Date: Thu, 9 Sep 2004 11:28:28 -0700
From: Matt Zimmerman <email address hidden>
To: <email address hidden>
Subject: Patch

tags 270437 patch
thanks

Herbert Xu pointed out that the problem is that growisofs opens the device
read-only, while read-write mode is necessary for some of the ioctls that it
uses. This trivial patch seems to get it working again, though I confess
the code is difficult to follow and I'm not sure if it has other side
effects.

http://growisofs-has-too-many-gotos.no-name-yet.com/patches/dvd+rw-tools.270437.diff

--
 - mdz

Revision history for this message
In , Maks Attems (debian-sternwelten) wrote : reassign

reassign #270437 dvd+rw-tools
reassign #269268 kernel
reassign #270297 kernel
reassign #270426 kernel
reassign #270883 kernel
reassign #269134 kernel
thanks

Revision history for this message
In , Maks Attems (debian-sternwelten) wrote : Re: Bug#270437: kernel-image-2.6.8-1-686: dvd+rw-tools in testing broken

severity 270437 normal
thanks

On Tue, 07 Sep 2004, Hendrik Naumann wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Package: kernel-image-2.6.8-1-686
> Version: 2.6.8-2
> Severity: critical

severity abuse.

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Message-ID: <email address hidden>
Date: Fri, 10 Sep 2004 00:38:14 +0200
From: maks attems <email address hidden>
To: <email address hidden>
Subject: reassign

reassign #270437 dvd+rw-tools
reassign #269268 kernel
reassign #270297 kernel
reassign #270426 kernel
reassign #270883 kernel
reassign #269134 kernel
thanks

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Message-ID: <email address hidden>
Date: Fri, 10 Sep 2004 00:47:41 +0200
From: maks attems <email address hidden>
To: <email address hidden>
Subject: Re: Bug#270437: kernel-image-2.6.8-1-686: dvd+rw-tools in testing broken

severity 270437 normal
thanks

On Tue, 07 Sep 2004, Hendrik Naumann wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Package: kernel-image-2.6.8-1-686
> Version: 2.6.8-2
> Severity: critical

severity abuse.

Revision history for this message
LaMont Jones (lamont) wrote :

Sadly, while some of the ioctls require write access, at least some IDE drives
fail to open for write: With the change in -2ubuntu2, my ide drive fails on the
added open call. From strace:
open("/dev/hdc", O_RDWR|O_LARGEFILE) = -1 EROFS (Read-only file system)
Changing the open call to O_RDONLY gets us back to the place where burning
works, but requires root.

That feels like a bug in the IDE driver...

I think growisofs wants to do the dup in the case where the open fails EROFS.

Revision history for this message
LaMont Jones (lamont) wrote :

Looking in drivers/cdrom/cdrom.c, cdrom_open, we find:

      if (fp->f_mode & FMODE_WRITE) {
             ret = -EROFS;
 ...

And a note in the changes (3.08) saying:
-- Always return -EROFS for write opens

So, which part of the kernel wants to change to let growisofs work?

Revision history for this message
Herbert Xu (herbert-gondor) wrote :

Created an attachment (id=44)
MO change

Please try reverting this patch to see if it helps.

Revision history for this message
Herbert Xu (herbert-gondor) wrote :

(In reply to comment #17)
> Looking in drivers/cdrom/cdrom.c, cdrom_open, we find:
>
> if (fp->f_mode & FMODE_WRITE) {
> ret = -EROFS;
> ...

The check happens in the next four lines.

> And a note in the changes (3.08) saying:
> -- Always return -EROFS for write opens

As usual, comments tend to become bogus after a while.

> So, which part of the kernel wants to change to let growisofs work?

You need to look at the code in cdrom_open_write() to see why it's failing.

Revision history for this message
Herbert Xu (herbert-gondor) wrote :

(In reply to comment #18)
> MO change
>
> Please try reverting this patch to see if it helps.

Oh please attach your complete dmesg as usual. Thanks.

Revision history for this message
Matt Zimmerman (mdz) wrote :

LaMont, did you try the patch yet?

Revision history for this message
LaMont Jones (lamont) wrote :

reverting the patch didn't help.

nothing in dmesg at the time of the test; here's the relevant portion of dmesg
from the boot:

Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
SIS5513: IDE controller at PCI slot 0000:00:02.5
ACPI: PCI interrupt 0000:00:02.5[A] -> GSI 16 (level, low) -> IRQ 177
SIS5513: chipset revision 0
SIS5513: not 100% native mode: will probe irqs later
SIS5513: SiS 962/963 MuTIOL IDE UDMA133 controller
    ide0: BM-DMA at 0x4000-0x4007, BIOS settings: hda:DMA, hdb:pio
    ide1: BM-DMA at 0x4008-0x400f, BIOS settings: hdc:DMA, hdd:DMA
hda: Maxtor 6Y200P0, ATA DISK drive
Using anticipatory io scheduler
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
hda: max request size: 1024KiB
hda: 398297088 sectors (203928 MB) w/7936KiB Cache, CHS=24792/255/63, UDMA(133)
 /dev/ide/host0/bus0/target0/lun0: p1 p2 < p5 p6 p7 p8 p9 p10 >
hdc: SONY DVD RW DRU-510A, ATAPI CD/DVD-ROM drive
hdd: HITACHI DVD-ROM GD-7500, ATAPI CD/DVD-ROM drive
ide1 at 0x170-0x177,0x376 on irq 15
SGI XFS with ACLs, security attributes, realtime, large block numbers, no debug
enabled

Revision history for this message
LaMont Jones (lamont) wrote :

The problem here is that cdrom_open_write fails because the drive in
question doesn't meet it's criteria, and we fall of the end of the
if-then-else mess.

Specifically, when we get to the top of that if-then-else,
cdi->ops->capability==0x3fffff, and cdi->mask=0x1e0010. That is,
CDROM_CAN will match any (combination) of:
    CDC_CD_R, CDC_CD_RW, CDC_DVD, CDC_DVD_R, CDC_RAM
but not any of:
    CDC_DVD_RAM, CDC_MO_DRIVE, CDC_MRW, CDC_MRW_W,

The following diff eliminates the problem, but is admittedly wrong in
oh so many ways...

lamont

--- drivers/cdrom/cdrom.c.save 2004-09-13 18:24:44.166754353 -0600
+++ drivers/cdrom/cdrom.c 2004-09-13 20:17:09.671937749 -0600
@@ -862,6 +862,8 @@
                ret = cdrom_ram_open_write(cdi);
        else if (CDROM_CAN(CDC_MO_DRIVE))
                ret = mo_open_write(cdi);
+ else if (CDROM_CAN(CDC_RAM))
+ ret=0;

        return ret;
 }

Revision history for this message
Herbert Xu (herbert-gondor) wrote :

(In reply to comment #23)
> The problem here is that cdrom_open_write fails because the drive in
> question doesn't meet it's criteria, and we fall of the end of the
> if-then-else mess.

Thanks for testing. Unfortunately it looks like the bug is still in growisofs.

What it should do is open an fd specifically for ioctls. Then it can open it
with O_NONBLOCK which bypasses the above check.

Revision history for this message
LaMont Jones (lamont) wrote :

All 5 places where the device is opened for ioctl's, changed to
O_RDWR|O_NONBLOCK. Tested with both mdz's burner and mine. Forwarding patch to
debian, fixed in 5.19.4.9.7-2ubuntu4.

Revision history for this message
LaMont Jones (lamont) wrote :

*** Bug 7977 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Keita Maehara (maehara) wrote : Re: Processed: Re: Bug#270437: kernel-image-2.6.8-1-686: dvd+rw-tools in testing broken

Now dvd+rw-tools 5.21.4.10.8-1 is available in testing as well as
unstable, which fixes this bug.

--
Keita Maehara <email address hidden>

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Message-ID: <email address hidden>
Date: Wed, 15 Sep 2004 23:09:14 +0900
From: Keita Maehara <email address hidden>
To: <email address hidden>
Cc: maks attems <email address hidden>,
 Keita Maehara <email address hidden>
Subject: Re: Processed: Re: Bug#270437: kernel-image-2.6.8-1-686: dvd+rw-tools in testing broken

Now dvd+rw-tools 5.21.4.10.8-1 is available in testing as well as
unstable, which fixes this bug.

--
Keita Maehara <email address hidden>

Revision history for this message
In , Hendrik Naumann (hn75) wrote : Re: Bug#270437 acknowledged by developer (Re: Processed: Re: Bug#270437: kernel-image-2.6.8-1-686: dvd+rw-tools in testing broken)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi

> Now dvd+rw-tools 5.21.4.10.8-1 is available in testing as well as
> unstable, which fixes this bug.

This version of dvd+rw-tools did NOT fix the problem.

But the kernel package version 2.6.8-3 fixed the problem.

Cheers Hendrik

- --
PGP ID 65C92061
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFBTsVwIfCsAmXJIGERAkBTAJ9/wgM6AsqZlA0C/W7hoWdzgXqeRACeL63P
K8lxhiovpWgETC4Lmj5IxPY=
=1uLq
-----END PGP SIGNATURE-----

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Message-Id: <email address hidden>
Date: Mon, 20 Sep 2004 13:56:23 +0200
From: Hendrik Naumann <email address hidden>
To: <email address hidden>
Cc: <email address hidden>
Subject: Re: Bug#270437 acknowledged by developer (Re: Processed: Re: Bug#270437:
 kernel-image-2.6.8-1-686: dvd+rw-tools in testing broken)

=2D----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi

> Now dvd+rw-tools 5.21.4.10.8-1 is available in testing as well as
> unstable, which fixes this bug.

This version of dvd+rw-tools did NOT fix the problem.=20

But the kernel package version 2.6.8-3 fixed the problem.

Cheers Hendrik

=2D --=20
PGP ID 65C92061
=2D----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFBTsVwIfCsAmXJIGERAkBTAJ9/wgM6AsqZlA0C/W7hoWdzgXqeRACeL63P
K8lxhiovpWgETC4Lmj5IxPY=3D
=3D1uLq
=2D----END PGP SIGNATURE-----

Changed in linux-source-2.6.15:
status: Unknown → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.