Author: hselasky
Date: Tue Jan 20 05:02:35 2015
New Revision: 277408
URL: https://svnweb.freebsd.org/changeset/base/277408

Log:
  MFC r276825 and r277372:
  Allow a block size of zero to mean 512 bytes, which is the most common
  block size for USB disks. This fixes support for "Action Cam SJ4000".

Modified:
  stable/9/sys/cam/scsi/scsi_da.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/cam/scsi/scsi_da.c
==============================================================================
--- stable/9/sys/cam/scsi/scsi_da.c     Tue Jan 20 05:00:38 2015        
(r277407)
+++ stable/9/sys/cam/scsi/scsi_da.c     Tue Jan 20 05:02:35 2015        
(r277408)
@@ -3089,11 +3089,12 @@ dadone(struct cam_periph *periph, union 
                         * give them an 'illegal' value we'll avoid that
                         * here.
                         */
-                       if (block_size == 0 && maxsector == 0) {
+                       if (block_size == 0) {
                                block_size = 512;
-                               maxsector = -1;
+                               if (maxsector == 0)
+                                       maxsector = -1;
                        }
-                       if (block_size >= MAXPHYS || block_size == 0) {
+                       if (block_size >= MAXPHYS) {
                                xpt_print(periph->path,
                                    "unsupportable block size %ju\n",
                                    (uintmax_t) block_size);
_______________________________________________
svn-src-stable-9@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-stable-9
To unsubscribe, send any mail to "svn-src-stable-9-unsubscr...@freebsd.org"

Reply via email to