From owner-freebsd-current@FreeBSD.ORG Wed Sep 25 16:06:05 2013 Return-Path: Delivered-To: current@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 ESMTP id 716DCBD1 for ; Wed, 25 Sep 2013 16:06:05 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-bk0-x232.google.com (mail-bk0-x232.google.com [IPv6:2a00:1450:4008:c01::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 02CF52FE4 for ; Wed, 25 Sep 2013 16:06:04 +0000 (UTC) Received: by mail-bk0-f50.google.com with SMTP id mz11so2352641bkb.37 for ; Wed, 25 Sep 2013 09:06:03 -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=WL5Gr85hE2KW7R37JHLpv37zbh9x9ZmocPrieugMxTs=; b=mTW9daYGU/8ImtXsPqqz/eK84WIrntLz44+oteYCrT1y+ge3SuQ6MCxRPZ3E/9yCKL KYH1yutS1mD7juRuGFFvqNPLTCBlfQAyYpx5RGayWWzWgJIlSP59rMmNCrEQYb+VMjyS RVkDEjTw6e9TFgMDdUL91KQ9YVTvi1ygPUmEFYbCVX+gQF9/iwZLgilqZX2GoolomWjq Z1MidQCIsXoHpoC0XsrZvs85N5BXHuuW3bxq0eOJc1oseerEzvqyVHaLmPYuEXm8IvJS diUq/B2mC0OiaKZbUdyOr8VE/ayJ945FhJfmb2EXm2vGj7qlMIOspNHA4xfyZAwvq5Wc LSeA== X-Received: by 10.205.14.197 with SMTP id pr5mr28581042bkb.6.1380125163096; Wed, 25 Sep 2013 09:06:03 -0700 (PDT) Received: from [192.168.1.102] (addt96.neoplus.adsl.tpnet.pl. [79.184.71.96]) by mx.google.com with ESMTPSA id no2sm14692812bkb.15.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 25 Sep 2013 09:06:02 -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: Wed, 25 Sep 2013 18:06:01 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <20130924104658.46313090@laptop.minsk.domain> <842AF8F6-E143-494C-B275-F395220732FF@freebsd.org> To: Sergey Kandaurov X-Mailer: Apple Mail (2.1510) Cc: "Sergey V. Dyatko" , current 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: Wed, 25 Sep 2013 16:06:05 -0000 Wiadomo=B6=E6 napisana przez Sergey Kandaurov w dniu = 24 wrz 2013, o godz. 14:04: > On 24 September 2013 15:44, Edward Tomasz Napiera=B3a = wrote: >> 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. >>=20 >> Sure. What do you think about this: >>=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 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); >>=20 >=20 > LGTM, except there is different indentation where for function calls > each new line aligned with the first function argument. Committed in a somewhat different form. I've also realized the new = initiator had a similar bug; could you please test both to make sure everything is = right now? Thanks!