Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Aug 2020 02:31:53 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r363822 - stable/12/usr.sbin/ctld
Message-ID:  <202008040231.0742VrvG068324@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Tue Aug  4 02:31:52 2020
New Revision: 363822
URL: https://svnweb.freebsd.org/changeset/base/363822

Log:
  MFC r363656: When modifying LUN pass "special" options too.
  
  Before switching to nvlists CTL merged previous and new options, so
  any options not passed just kept previous value.  Now CTL completely
  replaces them, so we must pass everything still relevant.

Modified:
  stable/12/usr.sbin/ctld/kernel.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/usr.sbin/ctld/kernel.c
==============================================================================
--- stable/12/usr.sbin/ctld/kernel.c	Tue Aug  4 02:20:15 2020	(r363821)
+++ stable/12/usr.sbin/ctld/kernel.c	Tue Aug  4 02:31:52 2020	(r363822)
@@ -776,6 +776,30 @@ kernel_lun_modify(struct lun *lun)
 	req.reqdata.modify.lun_id = lun->l_ctl_lun;
 	req.reqdata.modify.lun_size_bytes = lun->l_size;
 
+	if (lun->l_path != NULL) {
+		o = option_find(&lun->l_options, "file");
+		if (o != NULL) {
+			option_set(o, lun->l_path);
+		} else {
+			o = option_new(&lun->l_options, "file", lun->l_path);
+			assert(o != NULL);
+		}
+	}
+
+	o = option_find(&lun->l_options, "ctld_name");
+	if (o != NULL) {
+		option_set(o, lun->l_name);
+	} else {
+		o = option_new(&lun->l_options, "ctld_name", lun->l_name);
+		assert(o != NULL);
+	}
+
+	o = option_find(&lun->l_options, "scsiname");
+	if (o == NULL && lun->l_scsiname != NULL) {
+		o = option_new(&lun->l_options, "scsiname", lun->l_scsiname);
+		assert(o != NULL);
+	}
+
 	if (!TAILQ_EMPTY(&lun->l_options)) {
 		req.args_nvl = nvlist_create(0);
 		if (req.args_nvl == NULL) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202008040231.0742VrvG068324>