Tomo, Please find attached a patch that fixes three bugs in STARTSTOPUNIT 1, If power condition is != 0 then the LOEJ and START bits are to be ignored. I.e. we should not do any online/offline work. 2, Make sure LOEJ is set to 0 or 1, not as previously to 0 or 2 3, Only do the online/offline work IFF the removable attribute is set for this lun. I have also created some very basic tests to verify the functionality and for regression testing : iscsi-test --dataloss --test="*startstop*" iscsi://127.0.0.1/iqn.ronnie.test/1 0360_startstopunit_simple: =================== Media is removable. STARTSTOPUNIT should work Try to eject the media ... [OK] Try to mount the media again ... [OK] TEST T0360_startstopunit_simple [OK] 0361_startstopunit_pwrcnd: =================== Media is removable. STARTSTOPUNIT should work Try to eject media with PC != 0 ... [OK] Try to mount the media again ... [OK] TEST T0361_startstopunit_pwrcnd [OK] regards ronnie sahlberg
Attachment:
0001-STARTSTOPUNIT-bugfixes.patch.gz
Description: GNU Zip compressed data
Attachment:
0001-STARTSTOPUNIT-bugfixes.patch
Description: Binary data