mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-18 11:11:27 +00:00
scst_copy_mgr: Avoid that LUN removal triggers a BUG()
Reported-by: Jinpu Wang <jinpu.wang@profitbricks.com> git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7096 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -2522,9 +2522,8 @@ static bool scst_cm_is_lun_free(unsigned int lun)
|
||||
|
||||
static unsigned int scst_cm_get_lun(const struct scst_device *dev)
|
||||
{
|
||||
unsigned int res = -1;
|
||||
unsigned int res = SCST_MAX_LUN;
|
||||
int i;
|
||||
bool found = false;
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
@@ -2538,7 +2537,6 @@ static unsigned int scst_cm_get_lun(const struct scst_device *dev)
|
||||
list_for_each_entry(tgt_dev, head, sess_tgt_dev_list_entry) {
|
||||
if (tgt_dev->dev == dev) {
|
||||
res = tgt_dev->lun;
|
||||
found = true;
|
||||
TRACE_DBG("LUN %d found (full LUN %lld)",
|
||||
res, tgt_dev->lun);
|
||||
goto out;
|
||||
@@ -2546,8 +2544,6 @@ static unsigned int scst_cm_get_lun(const struct scst_device *dev)
|
||||
}
|
||||
}
|
||||
|
||||
sBUG_ON(!found);
|
||||
|
||||
out:
|
||||
TRACE_EXIT_RES(res);
|
||||
return res;
|
||||
|
||||
Reference in New Issue
Block a user