From owner-svn-src-all@FreeBSD.ORG Wed Sep 17 07:55:24 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4C171AEC; Wed, 17 Sep 2014 07:55:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 35E8A85A; Wed, 17 Sep 2014 07:55:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8H7tOja091867; Wed, 17 Sep 2014 07:55:24 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8H7tOLC091866; Wed, 17 Sep 2014 07:55:24 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201409170755.s8H7tOLC091866@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 17 Sep 2014 07:55:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271703 - head/sys/dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Sep 2014 07:55:24 -0000 Author: trasz Date: Wed Sep 17 07:55:23 2014 New Revision: 271703 URL: http://svnweb.freebsd.org/changeset/base/271703 Log: Fix LUN discovery for targets that don't support REPORT_LUNS, broken in r263741. At least with CTL (slightly modified to report SPC2) there is still some problem: it doesn't seem to find LUNs higher than 7. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iscsi/iscsi.c Modified: head/sys/dev/iscsi/iscsi.c ============================================================================== --- head/sys/dev/iscsi/iscsi.c Wed Sep 17 07:08:59 2014 (r271702) +++ head/sys/dev/iscsi/iscsi.c Wed Sep 17 07:55:23 2014 (r271703) @@ -2179,7 +2179,12 @@ iscsi_action(struct cam_sim *sim, union cpi->hba_misc = PIM_EXTLUNS; cpi->hba_eng_cnt = 0; cpi->max_target = 0; - cpi->max_lun = 0; + /* + * Note that the variable below is only relevant for targets + * that don't claim compliance with anything above SPC2, which + * means they don't support REPORT_LUNS. + */ + cpi->max_lun = 255; cpi->initiator_id = ~0; strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); strlcpy(cpi->hba_vid, "iSCSI", HBA_IDLEN);