scst_copy_mgr: Fix copy manager LUN wraparound (merge r8575 from trunk)

git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/3.3.x@8576 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2019-09-06 03:40:24 +00:00
parent ff9867252b
commit a3328841ee

View File

@@ -2594,8 +2594,10 @@ static int scst_cm_dev_register(struct scst_device *dev, uint64_t lun)
add_lun = true;
while (1) {
lun = scst_cm_next_lun++;
if (lun == SCST_MAX_LUN)
if (lun == SCST_MAX_LUN) {
scst_cm_next_lun = 0;
continue;
}
if (scst_cm_is_lun_free(lun))
break;
}