diff options
author | Jan Drzewiecki <jonie@icpnet.pl> | 2010-10-26 12:10:57 -0400 |
---|---|---|
committer | Martin Pitt <martin.pitt@ubuntu.com> | 2010-10-26 12:10:57 -0400 |
commit | d43e5e5b5a2e27fb75a6e19cca457ca40ad160e4 (patch) | |
tree | a78b10052bd22fc95c01a26b5d6f6df6a2cadc92 /extras | |
parent | 81956ed1dcdaf02f8d0fc114421e264d5589fe39 (diff) |
cdrom_id: Fix media state for unreadable DVDs
If the disc is unreadable and reading of the first 32 blocks fails set the
cd_media status to 0 (not present). This will prevent udev from executing blkid
next that tries to determine fs on the disc and which in this case may seem to
hang forever locking the drive.
Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
Diffstat (limited to 'extras')
-rw-r--r-- | extras/cdrom_id/cdrom_id.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c index ec001cde71..f0e1cbbc42 100644 --- a/extras/cdrom_id/cdrom_id.c +++ b/extras/cdrom_id/cdrom_id.c @@ -696,6 +696,7 @@ static int cd_media_info(struct udev *udev, int fd) scsi_cmd_set(udev, &sc, 9, 0); err = scsi_cmd_run(udev, &sc, fd, buffer, sizeof(buffer)); if ((err != 0)) { + cd_media = 0; info_scsi_cmd_err(udev, "READ FIRST 32 BLOCKS", err); return -1; } |