From 7f82dd84216ae50fdb9559226b6c75714de5d8b7 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Wed, 23 Feb 2011 17:11:07 +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. (Merged r3254 from the trunk.) git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/2.0.0.x@3255 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 2b1ebd86e..de36937e1 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -6268,6 +6268,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 048f98626..68fc2cb8e 100644 --- a/scst/src/scst_targ.c +++ b/scst/src/scst_targ.c @@ -1815,6 +1815,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; }