Module Name: src
Committed By: martin
Date: Tue Mar 23 18:56:18 UTC 2010
Modified Files:
src/sys/dev/scsipi: cd.c
Log Message:
If we find a device in non-2048 byte/block mode and manage to switch
it over, we need to adjust the capacity - so just read it again.
To generate a diff of this commit:
cvs rdiff -u -r1.300 -r1.301 src/sys/dev/scsipi/cd.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/scsipi/cd.c
diff -u src/sys/dev/scsipi/cd.c:1.300 src/sys/dev/scsipi/cd.c:1.301
--- src/sys/dev/scsipi/cd.c:1.300 Tue Mar 23 12:42:55 2010
+++ src/sys/dev/scsipi/cd.c Tue Mar 23 18:56:18 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: cd.c,v 1.300 2010/03/23 12:42:55 martin Exp $ */
+/* $NetBSD: cd.c,v 1.301 2010/03/23 18:56:18 martin Exp $ */
/*-
* Copyright (c) 1998, 2001, 2003, 2004, 2005, 2008 The NetBSD Foundation,
@@ -50,7 +50,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cd.c,v 1.300 2010/03/23 12:42:55 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cd.c,v 1.301 2010/03/23 18:56:18 martin Exp $");
#include "rnd.h"
@@ -1881,8 +1881,13 @@
return size;
if (blksize != 2048) {
- if (cd_setblksize(cd) == 0)
+ if (cd_setblksize(cd) == 0) {
blksize = 2048;
+ error = read_cd_capacity(cd->sc_periph,
+ &blksize, &size);
+ if (error)
+ return size;
+ }
}
cd->params.blksize = blksize;
cd->params.disksize = size;