From 928d8f60a744c312b35923b0f1d4db407bdba076 Mon Sep 17 00:00:00 2001 From: sbruno Date: Fri, 19 Apr 2013 05:28:08 +0000 Subject: [PATCH] MFC r249170 Notify CAM on state* change to a logical volume not status. This resolves the issues reported regarding camcontrol devlist not showing the rebuild states of volumes unless an explicit camcontrol rescan was executed. git-svn-id: svn://svn.freebsd.org/base/stable/9@249635 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sys/dev/ciss/ciss.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/dev/ciss/ciss.c b/sys/dev/ciss/ciss.c index 73edacefe..960ebfa55 100644 --- a/sys/dev/ciss/ciss.c +++ b/sys/dev/ciss/ciss.c @@ -3965,7 +3965,8 @@ static void ciss_notify_logical(struct ciss_softc *sc, struct ciss_notify *cn) { struct ciss_ldrive *ld; - int ostatus, bus, target; + int bus, target; + int rescan_ld; debug_called(2); @@ -3988,7 +3989,6 @@ ciss_notify_logical(struct ciss_softc *sc, struct ciss_notify *cn) /* * Update our idea of the drive's status. */ - ostatus = ciss_decode_ldrive_status(cn->data.logical_status.previous_state); ld->cl_status = ciss_decode_ldrive_status(cn->data.logical_status.new_state); if (ld->cl_lstatus != NULL) ld->cl_lstatus->status = cn->data.logical_status.new_state; @@ -3996,7 +3996,9 @@ ciss_notify_logical(struct ciss_softc *sc, struct ciss_notify *cn) /* * Have CAM rescan the drive if its status has changed. */ - if (ostatus != ld->cl_status) { + rescan_ld = (cn->data.logical_status.previous_state != + cn->data.logical_status.new_state) ? 1 : 0; + if (rescan_ld) { ld->cl_update = 1; ciss_notify_rescan_logical(sc); } -- 2.45.0