Date: Tue, 7 Apr 2020 03:19:00 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r359686 - head/sys/cam/ctl Message-ID: <202004070319.0373J0b8056312@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Tue Apr 7 03:19:00 2020 New Revision: 359686 URL: https://svnweb.freebsd.org/changeset/base/359686 Log: Fix panic on kern.cam.ctl.ha_role change after r333446. MFC after: 1 week Sponsored by: iXsystems, Inc. Modified: head/sys/cam/ctl/ctl_backend_block.c head/sys/cam/ctl/ctl_backend_ramdisk.c Modified: head/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_block.c Tue Apr 7 02:46:22 2020 (r359685) +++ head/sys/cam/ctl/ctl_backend_block.c Tue Apr 7 03:19:00 2020 (r359686) @@ -2574,8 +2574,10 @@ ctl_be_block_modify(struct ctl_be_block_softc *softc, if (params->lun_size_bytes != 0) be_lun->params.lun_size_bytes = params->lun_size_bytes; - nvlist_destroy(cbe_lun->options); - cbe_lun->options = nvlist_clone(req->args_nvl); + if (req->args_nvl != NULL) { + nvlist_destroy(cbe_lun->options); + cbe_lun->options = nvlist_clone(req->args_nvl); + } wasprim = (cbe_lun->flags & CTL_LUN_FLAG_PRIMARY); value = dnvlist_get_string(cbe_lun->options, "ha_role", NULL); Modified: head/sys/cam/ctl/ctl_backend_ramdisk.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_ramdisk.c Tue Apr 7 02:46:22 2020 (r359685) +++ head/sys/cam/ctl/ctl_backend_ramdisk.c Tue Apr 7 03:19:00 2020 (r359686) @@ -1252,8 +1252,10 @@ ctl_backend_ramdisk_modify(struct ctl_be_ramdisk_softc if (params->lun_size_bytes != 0) be_lun->params.lun_size_bytes = params->lun_size_bytes; - nvlist_destroy(cbe_lun->options); - cbe_lun->options = nvlist_clone(req->args_nvl); + if (req->args_nvl != NULL) { + nvlist_destroy(cbe_lun->options); + cbe_lun->options = nvlist_clone(req->args_nvl); + } wasprim = (cbe_lun->flags & CTL_LUN_FLAG_PRIMARY); value = dnvlist_get_string(cbe_lun->options, "ha_role", NULL);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202004070319.0373J0b8056312>