patch-2.2.11 linux/drivers/block/ide-cd.c

Next file: linux/drivers/block/ide-floppy.c
Previous file: linux/drivers/block/ida_ioctl.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.2.10/linux/drivers/block/ide-cd.c linux/drivers/block/ide-cd.c
@@ -2121,20 +2121,23 @@
 				 msf.cdmsf_frame0);
 
 		/* Make sure the TOC is up to date. */
-		stat = cdrom_read_toc (drive, NULL);
-		if (stat) return stat;
+		if (cmd != CDROMREADRAW) {
+			stat = cdrom_read_toc (drive, NULL);
+			if (stat) 
+				return stat;
 
-		toc = info->toc;
+			toc = info->toc;
 
-		if (lba < 0 || lba >= toc->capacity)
-			return -EINVAL;
+			if (lba < 0 || lba >= toc->capacity)
+				return -EINVAL;
+		}
 
 		buf = (char *) kmalloc (blocksize, GFP_KERNEL);
 		if (buf == NULL)
 			return -ENOMEM;
 
-		stat = cdrom_read_block (drive, format, lba, 1, buf, blocksize,
-					 NULL);
+		stat = cdrom_read_block (drive, format, lba, 1, buf,
+					 blocksize, NULL);
 
 		if (stat == 0) {
 			if (cmd == CDROMREADMODE2) {

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)