Description of problem: When attempting to close an open connection to a target which has ongoing I/O, instead of closing down the connection or exiting gracefully with an error, tgtadm segfaults leaving tgtd in an unusable state. The only working resolution appears to be killing tgtd and restarting. Version-Release number of selected component (if applicable): scsi-target-utils-0.0-5.20080917snap.el5 How reproducible: Attempt to remove an existing connection with "tgtadm --mode connection --op delete" while an initiator produces ongoing I/O on the target. Steps to Reproduce: 1. Create a target and LU. 2. Connect an initiator to the target and start streaming I/O on the LU. 3. Issue "tgtadm --mode connection --op delete --tid=X --sid=Y --cid=Z" Actual results: tgtadm exits with SIGSEGV. After this, tgtd cannot be shut down gracefully; any invocation of "service tgtd stop" results in an error. The only way to recover from this state is to 1. Kill tgtd with SIGKILL (SIGTERM won't work) 2. Remove the lockfile at /var/lock/subsys/tgtd 3. Restart tgtd with "service tgtd start" Expected results: Either tgtadm shuts down the connection gracefully, or it refuses to do so and exits with an error. In either event, tgtd should not be prevented from subsequently being shut down gracefully. Additional info: Appears to be fixed in upstream tgt 0.9.7.
Created attachment 351443 [details] strace from tgtadm
Changing severity to "high", as it may leave tgtd in an unusable state, thus may severely affect a system hosting an iSCSI target.
I believe this is fixed in the upstream release: http://stgt.berlios.de/releases/tgt-0.9.7.tar.bz2 Are you comfortable with trying that out? If not do not worry. I can make a rpm or try to replicate it here.
I already have, and it _is_ fixed in 0.9.7.
Update: 0.9.8 has been released. Mike, would you mind giving a brief status update on getting this fixed for RHEL?
It will make RHEL 5.5 for sure. It was too late for 5.4, but we are testing the 0.9.8 release wrt some other bugs we got late, and when that is done I am going to check with management to see if we can do something before 5.5.
Updated rpms are here: http://people.redhat.com/mchristi/target/tgt/5.5/ I synced up with the current upstream git code per the tgtd maintainer's suggestion.
Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: Previously, targetadmin (tgtadm) failed and the target daemon (tgtd) could not shut down when users attempted to an open connection with ongoing input/output. With this update, tgtadm shuts down the connection or exits gracefully with an error and the target daemon is no more prevented from subsequently being shut down gracefully.
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2011-0071.html