From owner-freebsd-current@FreeBSD.ORG Tue Sep 24 11:44:13 2013 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 715CEA4F for ; Tue, 24 Sep 2013 11:44:13 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-bk0-x22f.google.com (mail-bk0-x22f.google.com [IPv6:2a00:1450:4008:c01::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F3D9625CC for ; Tue, 24 Sep 2013 11:44:12 +0000 (UTC) Received: by mail-bk0-f47.google.com with SMTP id mx12so1628164bkb.6 for ; Tue, 24 Sep 2013 04:44:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=3ahEJqXWpJ2UfVeuRmTlP59ildZmtaE70sDhNo+crxU=; b=tbmaxKoxtZ7UtVwj1rLPVYjgYFXlY8noJ3hPx/N464G1R/eUJKMo8eV9xWyM3N1L+a w5594MIkI9jYNwDhia2aiLTVnXqChggX9evDVNE20BL35sstWX7r84zvc+hBOHTd7pp1 xEg6W362Eet6iwSQo3NQjqEVQOOoijpfR7mgYKqO5HWQQFn+OXoI5Ixox4o+0+WCH8qR fxnfzbQWe92kxg9L/peq+78f7W3L1w+aUdu01C/oQrUZWzoMjDG1TXTHcdzXpVd4O/t4 Tj9FbGjO1aOv3ZRwg4y+3Nue5ErfVlJp+1gQl4ODBO0RGg6PiCFjmO6OrOrLskac4qgL sn0g== X-Received: by 10.205.65.78 with SMTP id xl14mr22297809bkb.1.1380023051274; Tue, 24 Sep 2013 04:44:11 -0700 (PDT) Received: from [192.168.1.102] (adcv162.neoplus.adsl.tpnet.pl. [79.184.47.162]) by mx.google.com with ESMTPSA id b6sm11078306bko.16.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 24 Sep 2013 04:44:10 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Content-Type: text/plain; charset=iso-8859-2 Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\)) Subject: Re: panic: make_dev_credv: bad si_name (error=17, si_name=iscsi) From: =?iso-8859-2?Q?Edward_Tomasz_Napiera=B3a?= In-Reply-To: Date: Tue, 24 Sep 2013 13:44:09 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <842AF8F6-E143-494C-B275-F395220732FF@freebsd.org> References: <20130924104658.46313090@laptop.minsk.domain> To: Sergey Kandaurov X-Mailer: Apple Mail (2.1510) Cc: "Sergey V. Dyatko" , current X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Sep 2013 11:44:13 -0000 Wiadomo=B6=E6 napisana przez Sergey Kandaurov w dniu = 24 wrz 2013, o godz. 13:00: > On 24 September 2013 14:40, Sergey Kandaurov = wrote: >> On 24 September 2013 11:46, Sergey V. Dyatko = wrote: >>> Hi, >>>=20 >>> today I tried to play a bit with new iscsi >>>=20 >>> r255812 isn't fully complete fix? >>>=20 >> [...] >>> run `kldload iscsi_initiator` and got a panic: >>=20 >> Something like this quick'n'dirty should work. >> Compile tested only. >>=20 >> Index: sys/dev/iscsi_initiator/iscsi.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- sys/dev/iscsi_initiator/iscsi.c (revision 255841) >> +++ sys/dev/iscsi_initiator/iscsi.c (working copy) >> @@ -715,7 +715,8 @@ >> TUNABLE_INT_FETCH("net.iscsi_initiator.max_pdus", &max_pdus); >>=20 >> isc =3D malloc(sizeof(struct isc_softc), M_ISCSI, = M_ZERO|M_WAITOK); >> - isc->dev =3D make_dev(&iscsi_cdevsw, max_sessions, UID_ROOT, >> GID_WHEEL, 0600, "iscsi"); >> + isc->dev =3D make_dev_credf(MAKEDEV_CHECKNAME, &iscsi_cdevsw, = max_sessions, >> + NULL, UID_ROOT, GID_WHEEL, 0600, = "iscsi"); >> isc->dev->si_drv1 =3D isc; >> mtx_init(&isc->isc_mtx, "iscsi-isc", NULL, MTX_DEF); >=20 > Erm, of course it shall be checked against failure. Sure. What do you think about this: Index: sys/dev/iscsi_initiator/iscsi.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/dev/iscsi_initiator/iscsi.c (revision 255834) +++ sys/dev/iscsi_initiator/iscsi.c (working copy) @@ -715,8 +715,14 @@ iscsi_start(void) TUNABLE_INT_FETCH("net.iscsi_initiator.max_pdus", &max_pdus); =20 isc =3D malloc(sizeof(struct isc_softc), M_ISCSI, = M_ZERO|M_WAITOK); - isc->dev =3D make_dev(&iscsi_cdevsw, max_sessions, UID_ROOT, = GID_WHEEL, 0600, "iscsi"); - isc->dev->si_drv1 =3D isc; + isc->dev =3D make_dev_credf(MAKEDEV_CHECKNAME, &iscsi_cdevsw, = max_sessions, + NULL, UID_ROOT, GID_WHEEL, 0600, "iscsi"); + if (isc->dev =3D=3D NULL) { + xdebug("iscsi_initiator: make_dev_credf failed"); + // XXX: don't return; otherwise it would panic on unload + } else { + isc->dev->si_drv1 =3D isc; + } mtx_init(&isc->isc_mtx, "iscsi-isc", NULL, MTX_DEF); =20 TAILQ_INIT(&isc->isc_sess);