scsi_debug emulated CD does not implement READ_TOC

Bug #1043182 reported by Martin Pitt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Confirmed
Low
Unassigned

Bug Description

cdrom_id does not like the emulated SCSI CD-ROM from scsi_debug. This is a stopper for writing automatic tests around CDs.

Reproducer:
sudo modprobe scsi_debug
sudo dd if=/tmp/test.iso of=/dev/sdc # check the device!
echo 5 | sudo tee /sys/bus/pseudo/drivers/scsi_debug/ptype
echo 1 | sudo tee /sys/bus/pseudo/drivers/scsi_debug/add_host

You will notice that blkid detects it just fine:

$ sudo blkid -p /dev/sr1
/dev/sr1: VERSION="Joliet Extension" LABEL="CDROM" TYPE="iso9660" USAGE="filesystem"

but there are no file system properties in udev for the device, because the udev rules only run blkid for CDs with a recognized medium (to avoid unintended side effects and hangs):

/lib/udev/rules.d/60-persistent-storage.rules:KERNEL=="sr*", ENV{DISK_EJECT_REQUEST}!="?*", ENV{ID_CDROM_MEDIA_TRACK_COUNT_DATA}=="?*", ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="?*", IMPORT{program}="/sbin/blkid -o udev -p -u noraid -O $env{ID_CDROM_MEDIA_SESSION_LAST_OFFSET} $tempnode"
/lib/udev/rules.d/60-persistent-storage.rules:KERNEL=="sr*", ENV{DISK_EJECT_REQUEST}!="?*", ENV{ID_CDROM_MEDIA_TRACK_COUNT_DATA}=="?*", ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="", IMPORT{program}="/sbin/blkid -o udev -p -u noraid $tempnode"

However, cdrom_id fails:

$ /lib/udev/cdrom_id --debug /dev/sr1
main: probing: '/dev/sr1'
cd_inquiry: INQUIRY: [Linux ][scsi_debug ][0004]
info_scsi_cmd_err: GET CONFIGURATION failed with SK=5h/ASC=20h/ACQ=00h
cd_profiles: drive is pre-MMC2 and does not support 46h get configuration command
cd_profiles: trying to work around the problem
info_scsi_cmd_err: READ DISC INFORMATION failed with SK=5h/ASC=20h/ACQ=00h
cd_profiles_old_mmc: no current profile, but disc is present; assuming CD-ROM
info_scsi_cmd_err: READ TOC failed with SK=5h/ASC=20h/ACQ=00h
info_scsi_cmd_err: READ DISC INFORMATION failed with SK=5h/ASC=20h/ACQ=00h
ID_CDROM=1
ID_CDROM_MEDIA=1
ID_CDROM_MEDIA_CD=1

Revision history for this message
Martin Pitt (pitti) wrote :

This is also the case with cdrom_id from current systemd git head.

Revision history for this message
Martin Pitt (pitti) wrote :

OK, really not cdrom_id's fault, scsi_Debug does not implement these CD-ROM SCSI-2 commands.

summary: - cdrom_id does not recongize scsi_debug CD
+ scsi_debug emulated CD does not implement READ_TOC
affects: udev (Ubuntu) → linux (Ubuntu)
Revision history for this message
Martin Pitt (pitti) wrote :

Workaround for system tests:

$ cat /run/udev/rules.d/60-persistent-storage-scsi_debug.rules
KERNEL=="sr*", ENV{DISK_EJECT_REQUEST}!="?*", ATTRS{model}=="scsi_debug*", ENV{ID_CDROM_MEDIA}=="?*", IMPORT{program}="/sbin/blkid -o udev -p -u noraid $tempnode"

Changed in linux (Ubuntu):
importance: Undecided → Low
Revision history for this message
Brad Figg (brad-figg) wrote : Missing required logs.

This bug is missing log files that will aid in diagnosing the problem. From a terminal window please run:

apport-collect 1043182

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
Revision history for this message
Martin Pitt (pitti) wrote :

Description has a test case and this bug is totally hardware independent, no need for extra apport logs.

Changed in linux (Ubuntu):
importance: Low → Undecided
status: Incomplete → Confirmed
importance: Undecided → Low
tags: added: bot-stop-nagging
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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