From 8cf98331b0affb6dcf36a725656c8a1ab4a2e3f1 Mon Sep 17 00:00:00 2001 From: Alexander Motin Date: Thu, 18 Sep 2014 17:39:04 +0000 Subject: [PATCH] Make kernel to update LUN size from the backing storage on configuration reload also if that size was not specified in the new configuration. Previously it happened only if size was explicitly changed in config. MFC after: 3 days --- usr.sbin/ctld/ctld.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr.sbin/ctld/ctld.c b/usr.sbin/ctld/ctld.c index bfdf5d056693..e4c2eda0fcf7 100644 --- a/usr.sbin/ctld/ctld.c +++ b/usr.sbin/ctld/ctld.c @@ -1413,7 +1413,8 @@ conf_apply(struct conf *oldconf, struct conf *newconf) if (oldtarg != NULL) { oldlun = lun_find(oldtarg, newlun->l_lun); if (oldlun != NULL) { - if (newlun->l_size != oldlun->l_size) { + if (newlun->l_size != oldlun->l_size || + newlun->l_size == 0) { log_debugx("resizing lun %d, " "target %s, CTL lun %d", newlun->l_lun,