Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can a LUN be added to more than one spdk_scsi_dev ? #100

Closed
naresh-gottumukkala opened this issue Jan 17, 2017 · 5 comments
Closed

Can a LUN be added to more than one spdk_scsi_dev ? #100

naresh-gottumukkala opened this issue Jan 17, 2017 · 5 comments
Labels
Milestone

Comments

@naresh-gottumukkala
Copy link

Hi,

From the code it looks like we can not add a lun (i.e a bdev like /dev/ram0) to more than one spdk_scsi_dev. But the spdk_scsi_dev_add_lun function in lib/dev.c is not checking for return status of spdk_scsi_lun_claim(lun) before updating dev and id fields in spdk_scsi_lun structure. Because of this dev and id values of previous spdk_scsi_dev are overwritten by new spdk_scsi_dev and when user tries to add lun to second spdk_scsi_dev it succeeds.

Since most of the other code depends on lun->dev field like for example spdk_bdev_scsi_report_luns, wrong values are returned.

Our iscsi.conf

[TargetNode1]
TargetName disk1
Mapping PortalGroup1 InitiatorGroup1
LUN0 Malloc0
LUN1 Malloc1

[TargetNode2]
TargetName disk2
Mapping PortalGroup2 InitiatorGroup2
LUN0 Malloc1 # Please note Malloc1 bdev reused

Can some one please confirm the expected behaviour ?

Thanks & Regards,
Naresh

@jimharris
Copy link
Member

jimharris commented Jan 17, 2017 via email

@naresh-gottumukkala
Copy link
Author

Hi Jim,

Thanks for confirming. Does that mean a lun can not be added to more than one spdk_scsi_dev ?

@benlwalker
Copy link
Member

To confirm - with our current design a LUN cannot be added to more than one spdk_scsi_dev. We do not support "shared LUNs" currently, which would require us to emulate SCSI reservations. This is not to say that it would be impossible to do so in the future.

@benlwalker benlwalker added the bug label Jan 30, 2017
@benlwalker benlwalker added this to the 17.03 milestone Jan 30, 2017
@naresh-gottumukkala
Copy link
Author

Thanks a lot Ben.

@benlwalker
Copy link
Member

We now support creating multiple luns that point at the same bdev, which is mostly the same thing that was requested here. We still do not emulate SCSI or NVMe reservations in the iSCSI and NVMe-oF targets. I'm going to close this bug out. If SCSI or NVMe reservation emulation is necessary, please open a new issue to request it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants