Set default block size for CD to expected 2048 bytes.

This commit is contained in:
Alexander Motin 2015-10-02 11:16:46 +00:00
parent 6ae1554a5d
commit 6f2f92a5bf
2 changed files with 5 additions and 1 deletions

View 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);

View 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