Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Apr 2010 11:46:42 +0000 (UTC)
From:      Andriy Gapon <avg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r207059 - stable/8/sys/cam/scsi
Message-ID:  <201004221146.o3MBkg1h066837@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avg
Date: Thu Apr 22 11:46:42 2010
New Revision: 207059
URL: http://svn.freebsd.org/changeset/base/207059

Log:
  MFC r206648,206651: scsi_cd: CD_FLAG_VALID_MEDIA is sufficient to set
  d_sectorsize and d_mediasize
  
  PR:		kern/138789

Modified:
  stable/8/sys/cam/scsi/scsi_cd.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/cam/scsi/scsi_cd.c
==============================================================================
--- stable/8/sys/cam/scsi/scsi_cd.c	Thu Apr 22 09:30:02 2010	(r207058)
+++ stable/8/sys/cam/scsi/scsi_cd.c	Thu Apr 22 11:46:42 2010	(r207059)
@@ -2777,8 +2777,12 @@ cdcheckmedia(struct cam_periph *periph)
 		softc->flags &= ~(CD_FLAG_VALID_MEDIA|CD_FLAG_VALID_TOC);
 		cdprevent(periph, PR_ALLOW);
 		return (error);
-	} else
+	} else {
 		softc->flags |= CD_FLAG_VALID_MEDIA;
+		softc->disk->d_sectorsize = softc->params.blksize;
+		softc->disk->d_mediasize =
+		    (off_t)softc->params.blksize * softc->params.disksize;
+	}
 
 	/*
 	 * Now we check the table of contents.  This (currently) is only
@@ -2867,9 +2871,6 @@ cdcheckmedia(struct cam_periph *periph)
 	}
 
 	softc->flags |= CD_FLAG_VALID_TOC;
-	softc->disk->d_sectorsize = softc->params.blksize;
-	softc->disk->d_mediasize =
-	    (off_t)softc->params.blksize * softc->params.disksize;
 
 bailout:
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201004221146.o3MBkg1h066837>