open-iscsi / tcmu-runner

A daemon that handles the userspace side of the LIO TCM-User backstore.
Apache License 2.0
190 stars 148 forks source link

fbo doesn't work when backing file is block device #661

Open JuniorJPDJ opened 3 years ago

JuniorJPDJ commented 3 years ago

I'm trying to use some very weird configuration and I need my virtual cd-rom to be read from block device.

When I attach block device to user:fbo and then to iSCSI target I get this in dmesg:

[121129.457307] cmd exceeds last lba 64 (lba 64, sectors 4)
[121129.457397] cmd exceeds last lba 64 (lba 64, sectors 4)
[121129.457476] cmd exceeds last lba 64 (lba 64, sectors 4)
[121129.457553] cmd exceeds last lba 64 (lba 64, sectors 4)
[121129.457632] cmd exceeds last lba 64 (lba 64, sectors 4)
[121129.457728] cmd exceeds last lba 64 (lba 64, sectors 4)
[121129.457806] cmd exceeds last lba 64 (lba 64, sectors 4)
[121130.910366] cmd exceeds last lba 64 (lba 64, sectors 4)
[121130.910451] cmd exceeds last lba 64 (lba 64, sectors 4)
[121130.910524] cmd exceeds last lba 64 (lba 64, sectors 4)
[121130.910612] cmd exceeds last lba 64 (lba 64, sectors 4)
[121130.910685] cmd exceeds last lba 64 (lba 64, sectors 4)
[121130.910757] cmd exceeds last lba 64 (lba 64, sectors 4)
[121130.910829] cmd exceeds last lba 64 (lba 64, sectors 4)
[121130.910998] cmd exceeds last lba 64 (lba 64, sectors 4)
[121130.911085] cmd exceeds last lba 64 (lba 64, sectors 4)
[121130.911185] cmd exceeds last lba 64 (lba 64, sectors 4)
[121130.911283] cmd exceeds last lba 64 (lba 64, sectors 4)
[121131.871716] cmd exceeds last lba 64 (lba 64, sectors 4)

and IO error on initiator side.

To reproduce:

$ dev="$(losetup -f -r --show "SOME ISO FILE PATH")"
$ size="$(blockdev --getsize64 "$dev")"
$ targetcli /backstores/user:fbo/ create cfgstring="$dev" size="$size" name=iso
$ targetcli /iscsi/ create iqn.2021-07.com.example:test
$ targetcli /iscsi/iqn.2021-07.com.example:test/tpg1/luns/ create /backstores/user:fbo/iso

and connect to target with something (eg. iPXE)

$ sanboot -d 0xe0 iscsi:IP ADDRESS::::iqn.2021-07.com.example:test
bla bla bla IO ERROR