There is a logcal bug, that the logoutFalg == ''0'' will nerver be true, enven though I execute iscsi rescan comamnd: "iscsiadm -m session -R". It seems that the rescan command only refresh the new added lun, while could not refresh lun the which has already been removed in target side . so that the link in '/dev/disk/by-path' wouldn't be removed too. And in some linux system, such as Suse, it enven does not has this formatted link. So logout a session shouldn't depend on the link number.
There is a logcal bug, that the
logoutFalg == ''0''
will nerver be true, enven though I execute iscsi rescan comamnd: "iscsiadm -m session -R". It seems that the rescan command only refresh the new added lun, while could not refresh lun the which has already been removed in target side . so that the link in '/dev/disk/by-path' wouldn't be removed too. And in some linux system, such as Suse, it enven does not has this formatted link. So logout a session shouldn't depend on the link number.https://github.com/opensds/opensds/blob/1961ff33ad03ffd110caddd411a6bc1d6cef916e/contrib/connector/iscsi/helper.go#L303