diff options
author | mav <mav@FreeBSD.org> | 2015-10-02 11:16:46 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2015-10-02 11:16:46 +0000 |
commit | 011d697052f6a8a1e64698bd6405906873cf35cd (patch) | |
tree | 295e9e6e4335350a604eae74fe794fb81b71e5e7 /usr.sbin | |
parent | 8cc71b38c27f2be8ba4c227078a51c63847a89de (diff) | |
download | FreeBSD-src-011d697052f6a8a1e64698bd6405906873cf35cd.zip FreeBSD-src-011d697052f6a8a1e64698bd6405906873cf35cd.tar.gz |
Set default block size for CD to expected 2048 bytes.
Diffstat (limited to 'usr.sbin')
-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 |