From owner-svn-src-head@freebsd.org Tue Jul 28 22:32:50 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C1BA537646D; Tue, 28 Jul 2020 22:32:50 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BGWdt4mMKz406Q; Tue, 28 Jul 2020 22:32:50 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8772E16481; Tue, 28 Jul 2020 22:32:50 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06SMWovq071104; Tue, 28 Jul 2020 22:32:50 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06SMWob3071103; Tue, 28 Jul 2020 22:32:50 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202007282232.06SMWob3071103@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 28 Jul 2020 22:32:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363656 - head/usr.sbin/ctld X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/usr.sbin/ctld X-SVN-Commit-Revision: 363656 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jul 2020 22:32:50 -0000 Author: mav Date: Tue Jul 28 22:32:50 2020 New Revision: 363656 URL: https://svnweb.freebsd.org/changeset/base/363656 Log: 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. MFC after: 1 week Sponsored by: iXsystems, Inc. Modified: head/usr.sbin/ctld/kernel.c Modified: head/usr.sbin/ctld/kernel.c ============================================================================== --- head/usr.sbin/ctld/kernel.c Tue Jul 28 20:06:16 2020 (r363655) +++ head/usr.sbin/ctld/kernel.c Tue Jul 28 22:32:50 2020 (r363656) @@ -777,6 +777,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) {