]> xenbits.xensource.com Git - people/liuw/freebsd.git/commitdiff
Don't try to replicate mode pages not present on this device.
authormav <mav@FreeBSD.org>
Mon, 26 Oct 2015 14:14:56 +0000 (14:14 +0000)
committermav <mav@FreeBSD.org>
Mon, 26 Oct 2015 14:14:56 +0000 (14:14 +0000)
MFC after: 3 days

sys/cam/ctl/ctl.c

index 1013ae7f444ad5ba38b0fde4ba97c489d4d106e7..0d10721bbf7cdfafd957150c266e73e42fbe30e7 100644 (file)
@@ -927,6 +927,11 @@ ctl_isc_announce_mode(struct ctl_lun *lun, uint32_t initidx,
        }
        if (i == CTL_NUM_MODE_PAGES)
                return;
+
+       /* Don't try to replicate pages not present on this device. */
+       if (lun->mode_pages.index[i].page_data == NULL)
+               return;
+
        bzero(&msg.mode, sizeof(msg.mode));
        msg.hdr.msg_type = CTL_MSG_MODE_SYNC;
        msg.hdr.nexus.targ_port = initidx / CTL_MAX_INIT_PER_PORT;