#25 Lock error if requested lun > g_disk_num_luns

open
nobody
None
5
2008-11-16
2008-11-16
David Wright
No

If the target receives a request with a LUN number > g_disk_num_luns (e.g. lun==1 when only 1 lun is configured) it will exit with a lock error.

This is because the g_device_stats lock is only initiated up to the configured number of luns, but an attempt is made to lock it with the request lun even if the request lun isn't valid. This appears to happen with the Linux open iscsi initiator on occasion.

This needs to be fixed in disk.c:1967 and target.c:726,889

Discussion