diff options
-rw-r--r-- | usr.sbin/ctld/ctld.c | 5 | ||||
-rw-r--r-- | usr.sbin/ctld/ctld.h | 1 |
2 files changed, 5 insertions, 1 deletions
diff --git a/usr.sbin/ctld/ctld.c b/usr.sbin/ctld/ctld.c index 12474ea..4813ae0 100644 --- a/usr.sbin/ctld/ctld.c +++ b/usr.sbin/ctld/ctld.c @@ -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); diff --git a/usr.sbin/ctld/ctld.h b/usr.sbin/ctld/ctld.h index 6eb878c..51775d7 100644 --- a/usr.sbin/ctld/ctld.h +++ b/usr.sbin/ctld/ctld.h @@ -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 |