mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-17 10:41:26 +00:00
scst_copy_mgr: Fix support for auto_cm_assignment=0
Only check whether a LUN has already been registered with the copy manager for the auto_cm_assignment=1 case since with auto CM assignment disabled scst_cm_dev_register() is called after the LUN has been registered. Reported-by: Eitan Cohen <eitancohen456@gmail.com> git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9492 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -2559,14 +2559,14 @@ static int scst_cm_dev_register(struct scst_device *dev, uint64_t lun)
|
||||
|
||||
TRACE_DBG("dev %s, LUN %ld", dev->virt_name, (unsigned long)lun);
|
||||
|
||||
if (scst_cm_get_lun(dev) != SCST_MAX_LUN) {
|
||||
TRACE_DBG("Copy Manager already registered device %s",
|
||||
dev->virt_name);
|
||||
res = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (lun == SCST_MAX_LUN) {
|
||||
if (scst_cm_get_lun(dev) != SCST_MAX_LUN) {
|
||||
TRACE_DBG("Copy Manager already registered device %s",
|
||||
dev->virt_name);
|
||||
res = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
add_lun = true;
|
||||
while (1) {
|
||||
lun = scst_cm_next_lun++;
|
||||
|
||||
Reference in New Issue
Block a user