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
This commit is contained in:
Bart Van Assche
2011-02-23 17:08:22 +00:00
parent 06249d693b
commit 55eed60c59
2 changed files with 6 additions and 0 deletions

View File

@@ -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;
}

View File

@@ -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;
}