From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Benjamin Marzinski" Subject: [PATCH v3 3/7] libmultipath: cleanup orphan device states Date: Tue, 14 Feb 2017 20:16:53 -0600 Message-ID: <1487125017-22049-4-git-send-email-bmarzins@redhat.com> References: <1487125017-22049-1-git-send-email-bmarzins@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1487125017-22049-1-git-send-email-bmarzins@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com To: device-mapper development List-Id: dm-devel.ids After a path device is orphaned, multipathd stops checking its state. However, multipathd show state still shows its old state. It should display "undef unknown" instead. Signed-off-by: Benjamin Marzinski --- libmultipath/print.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libmultipath/print.c b/libmultipath/print.c index 5b03383..00a3626 100644 --- a/libmultipath/print.c +++ b/libmultipath/print.c @@ -392,7 +392,7 @@ snprint_dev_t (char * buff, size_t len, struct path * pp) static int snprint_offline (char * buff, size_t len, struct path * pp) { - if (!pp) + if (!pp || !pp->mpp) return snprintf(buff, len, "unknown"); else if (pp->offline) return snprintf(buff, len, "offline"); @@ -403,7 +403,7 @@ snprint_offline (char * buff, size_t len, struct path * pp) static int snprint_chk_state (char * buff, size_t len, struct path * pp) { - if (!pp) + if (!pp || !pp->mpp) return snprintf(buff, len, "undef"); switch (pp->state) { -- 1.8.3.1