NetBSD Problem Report #50208

From  Fri Sep  4 15:24:24 2015
Return-Path: <>
Received: from ( [])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "", Issuer "Postmaster" (verified OK))
	by (Postfix) with ESMTPS id 1D206A6551
	for <>; Fri,  4 Sep 2015 15:24:24 +0000 (UTC)
Message-Id: <>
Date: Fri,  4 Sep 2015 18:24:14 +0300 (EEST)
From: (Andreas Gustafsson)
Reply-To: (Andreas Gustafsson)
Subject: iscsi-target prints scary messages
X-Send-Pr-Version: 3.95

>Number:         50208
>Category:       bin
>Synopsis:       iscsi-target prints scary messages
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    mlelstv
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Sep 04 15:25:00 +0000 2015
>Last-Modified:  Fri Jun 03 08:50:00 +0000 2016
>Originator:     Andreas Gustafsson
>Release:        NetBSD-current, source date 2015.

System: NetBSD
Architecture: i386
Machine: i386

Now that PR 49616 is fixed, I figured I'd try to create a minimal
automated iSCSI test.

I was able to successfully export an iSCSI target and attach it to an
initiator running on the same machine, and this successfully attached
a new sd device that appears to work.  However, iscsi-target logged
some messages on the console that leave me less than confident that
everything is actually working correctly.

This problem is not new; I tried running the same test against
-current sources from early 2011 with the same result.


On a machine that is not already using iSCSI and has a non-empty
hostname, execute the following as root in a Bourne shell:

   # Start target with default configuration from /etc/iscsi/targets
   # Wait for target to start
   sleep 5

   # Start initiator per example in iscsictl(8)
   modload iscsi
   modstat iscsi
   iscsictl add_send_target -a localhost
   iscsictl refresh_targets
   iscsictl list_targets
   iscsictl login -P 2
   # Wait for any new messages to appear in /var/log/messages
   sleep 5
   grep 'iscsi.*ERROR' /var/log/messages

This will show messages like the following:

   Sep  4 15:15:33 foo iscsi-target: pid 1607:/tmp/bracket/build/2015. ***ERROR*** CmdSN
   Sep  4 15:15:33 foo iscsi-target: pid 1607:/tmp/bracket/build/2015. ***ERROR*** logout_command_t() failed 
   Sep  4 15:15:33 foo iscsi-target: pid 1607:/tmp/bracket/build/2015. ***ERROR*** execute_t() failed 
   Sep  4 15:15:33 foo iscsi-target: pid 1607:/tmp/bracket/build/2015. ***ERROR*** cmd.tsih 0 not found 




Responsible-Changed-From-To: bin-bug-people->mlelstv
Responsible-Changed-When: Fri, 03 Jun 2016 06:31:07 +0000
working on iscsi initiator

From: Michael van Elst <>
Subject: Re: bin/50208 (iscsi-target prints scary messages)
Date: Fri, 3 Jun 2016 10:43:43 +0200

 The target is code is very simple and doesn't follow the iSCSI specification.
 Command requests are expected in order and immediate commands aren't handled
 at all or by ignoring the sequence numbers.

 The kernel initiator however uses immediate commands for session startup
 and shutdown.

 A simple "fix" is to ignore sequence numbers for all immediate commands.

                                 Michael van Elst
                                 "A potential Snark may lurk in every tree."


NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD:,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.