]> xenbits.xensource.com Git - people/julieng/freebsd.git/commitdiff
Set default block size for CD to expected 2048 bytes.
authormav <mav@FreeBSD.org>
Fri, 2 Oct 2015 11:16:46 +0000 (11:16 +0000)
committermav <mav@FreeBSD.org>
Fri, 2 Oct 2015 11:16:46 +0000 (11:16 +0000)
usr.sbin/ctld/ctld.c
usr.sbin/ctld/ctld.h

index 12474ea782a7e93d53581379806e7e349cddc63b..4813ae0e49034b88f2522a6e8063e3b0b8114c37 100644 (file)
@@ -1661,7 +1661,10 @@ conf_verify_lun(struct lun *lun)
                }
        }
        if (lun->l_blocksize == 0) {
-               lun_set_blocksize(lun, DEFAULT_BLOCKSIZE);
+               if (lun->l_device_type == 5)
+                       lun_set_blocksize(lun, DEFAULT_CD_BLOCKSIZE);
+               else
+                       lun_set_blocksize(lun, DEFAULT_BLOCKSIZE);
        } else if (lun->l_blocksize < 0) {
                log_warnx("invalid blocksize for lun \"%s\"; "
                    "must be larger than 0", lun->l_name);
index 6eb878cad7b781bf4680ea9f38329a24357a362a..51775d76a4a12b2650822567217531f5db1113f3 100644 (file)
@@ -43,6 +43,7 @@
 #define        DEFAULT_CONFIG_PATH             "/etc/ctl.conf"
 #define        DEFAULT_PIDFILE                 "/var/run/ctld.pid"
 #define        DEFAULT_BLOCKSIZE               512
+#define        DEFAULT_CD_BLOCKSIZE            2048
 
 #define        MAX_LUNS                        1024
 #define        MAX_NAME_LEN                    223