[Bug 967984] Re: iSCSI target administration utility (ietadm) not detecting inactive sessions
James Page
james.page at ubuntu.com
Tue Sep 4 11:03:21 UTC 2012
** Description changed:
+ [Impact]
+ Administrators will not be able to delete targets even when all sessions are inactive.
+
+ [Test Case]
+ sudo apt-get install iscsitarget open-iscsi
+ echo "ISCSITARGET_ENABLE=true" | sudo tee /etc/default/iscsitarget
+ sudo service iscsitarget restart
+ sudo dd if=/dev/zero of=/fs.iscsi.disk bs=1M count=512
+ sudo ietadm --op new --tid=1 --params=Name=mytarget
+ sudo ietadm --op new --tid=1 --lun=0 --params=Path=/fs.iscsi.disk
+ cat /proc/net/iet/session
+ cat /proc/net/iet/volume
+ sudo iscsiadm -m discovery -t st -p 127.0.0.1:3260
+ sudo iscsiadm -m node -T mytarget -p 127.0.0.1:3260 --login
+ cat /proc/net/iet/session
+ cat /proc/net/iet/volume
+ sudo iscsiadm -m session --logout
+ sudo ietadm --op delete --tid=1
+ cat /proc/net/iet/session
+ cat /proc/net/iet/volume
+
+ Failure is indicated by "Device or resource busy." during the delete
+ operation.
+
+ [Regression Potential]
+ The fix is in the event layer of the DKMS module; it ensures that the session removal event gets to the ietd with kernels >= 3.2.
+
+ [Original Bug Report]
Using up to date Ubuntu precise (3/28/12) with:
iscsitarget - 1.4.20.2-5ubuntu2
iscsitarget-dkms - 1.4.20.2-5ubuntu2
iSCSI target administration utility appears to not detect inactive
sessions correctly.
Replicating bug:
creating a sparse image:
dd if=/dev/zero of=/fs.iscsi.disk bs=1M count=512
then creating target:
root at ubuntu-precise:~# ietadm --op new --tid=1 --params=Name=mytarget
- root at ubuntu-precise:~# ietadm --op new --tid=1 --lun=0 --params=Path=/fs.iscsi.disk
+ root at ubuntu-precise:~# ietadm --op new --tid=1 --lun=0 --params=Path=/fs.iscsi.disk
shows available:
- root at ubuntu-precise:~# cat /proc/net/iet/session
+ root at ubuntu-precise:~# cat /proc/net/iet/session
tid:1 name:mytarget
- root at ubuntu-precise:~# cat /proc/net/iet/volume
+ root at ubuntu-precise:~# cat /proc/net/iet/volume
tid:1 name:mytarget
- lun:0 state:0 iotype:fileio iomode:wt blocks:1048576 blocksize:512 path:/fs.iscsi.disk
+ lun:0 state:0 iotype:fileio iomode:wt blocks:1048576 blocksize:512 path:/fs.iscsi.disk
login by client is successful:
root at ubuntu-precise:~# iscsiadm -m node -T mytarget -p 172.16.2.133:3260 --login
Logging in to [iface: default, target: mytarget, portal: 172.16.2.133,3260]
Login to [iface: default, target: mytarget, portal: 172.16.2.133,3260]: successful
and shows active session:
- root at ubuntu-precise:~# cat /proc/net/iet/session
+ root at ubuntu-precise:~# cat /proc/net/iet/session
tid:1 name:mytarget
- sid:281475014263296 initiator:iqn.1993-08.org.debian:01:2f524641a62d
- cid:0 ip:172.16.2.133 state:active hd:none dd:none
+ sid:281475014263296 initiator:iqn.1993-08.org.debian:01:2f524641a62d
+ cid:0 ip:172.16.2.133 state:active hd:none dd:none
ietadm properly shows active and refuses to delete which is expected:
root at ubuntu-precise:~# ietadm --op delete --tid=1
Device or resource busy.
client logs out:
root at ubuntu-precise:~# iscsiadm -m session --logout
Logging out of session [sid: 2, target: mytarget, portal: 172.16.2.133,3260]
Logout of [sid: 2, target: mytarget, portal: 172.16.2.133,3260]: successful
no longer shows session active:
- root at ubuntu-precise:~# cat /proc/net/iet/session
+ root at ubuntu-precise:~# cat /proc/net/iet/session
tid:1 name:mytarget
but ietadm refuses to acknowledge the disconnect and release the target
and a ietadm delete fails saying "in use":
root at ubuntu-precise:~# ietadm --op delete --tid=1
Device or resource busy.
--
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to the bug report.
https://bugs.launchpad.net/bugs/967984
Title:
iSCSI target administration utility (ietadm) not detecting inactive
sessions
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/iscsitarget/+bug/967984/+subscriptions
More information about the Ubuntu-server-bugs
mailing list