From 55eed60c59ebca6150d8144cfbd0e7a5682a912b Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Wed, 23 Feb 2011 17:08:22 +0000 Subject: [PATCH] Keep unit attention list empty flag and the list itself in sync. Without this patch hundreds of "scst: scst_set_pending_UA:6216:Setting pending UA cmd ..." messages are logged after a LUN has been added or removed. This patch fixes a bug that was reported by Ido Benda. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3254 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_lib.c | 3 +++ scst/src/scst_targ.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index f41143b46..02155ce60 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -6173,6 +6173,9 @@ again: "needed global UA %p", ua); list_del(&ua->UA_list_entry); + if (list_empty(&tgt_dev->UA_list)) + clear_bit(SCST_TGT_DEV_UA_PENDING, + &tgt_dev->tgt_dev_flags); mempool_free(ua, scst_ua_mempool); break; } diff --git a/scst/src/scst_targ.c b/scst/src/scst_targ.c index 7380f8e0b..c0b093cfd 100644 --- a/scst/src/scst_targ.c +++ b/scst/src/scst_targ.c @@ -1739,6 +1739,9 @@ out_compl: "REPORTED LUNS DATA CHANGED UA " "%p", ua); list_del(&ua->UA_list_entry); + if (list_empty(&tgt_dev->UA_list)) + clear_bit(SCST_TGT_DEV_UA_PENDING, + &tgt_dev->tgt_dev_flags); mempool_free(ua, scst_ua_mempool); break; }