From owner-freebsd-current@FreeBSD.ORG Tue Sep 24 12:04:21 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 E1667634; Tue, 24 Sep 2013 12:04:20 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-wi0-x22f.google.com (mail-wi0-x22f.google.com [IPv6:2a00:1450:400c:c05::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 580752767; Tue, 24 Sep 2013 12:04:20 +0000 (UTC) Received: by mail-wi0-f175.google.com with SMTP id ez12so3654474wid.14 for ; Tue, 24 Sep 2013 05:04:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=5f3TcfS8ph5blBuyKjAgeGp0AEtkLz6+T2l8YQhUG20=; b=uO4JQa5/nzQTkgLjfc/xR403FyvEErNxhGOCrzvkY85PGiKupLTxpoDDaa8h14DOji gGTSudZZPOfPVXu/I4StsCJmNLN8a2wtcrVIILV2Fh9Xx4KVNaVj48R9if2BZrCrWxIa OWYW9Wflziss24akW+0AQfROs+K2WdhFOfS6MZi6lD84Lm64Y/dfb8c+749QZGf1KD8K yoPJvqs6GRSE4Fq9rodY4gcoaOJ50PR2JFqc3dZgR7naSrc/ENox12VJPpwDHZpDLo7H km8+dmGdCHRd9M+5+dRc2uqPar4VGr/+kQtrspLkOphq0o5gr9RuUU58U+DUxghDdMcs DkDw== MIME-Version: 1.0 X-Received: by 10.180.37.227 with SMTP id b3mr17753263wik.24.1380024258670; Tue, 24 Sep 2013 05:04:18 -0700 (PDT) Received: by 10.216.62.5 with HTTP; Tue, 24 Sep 2013 05:04:18 -0700 (PDT) In-Reply-To: <842AF8F6-E143-494C-B275-F395220732FF@freebsd.org> References: <20130924104658.46313090@laptop.minsk.domain> <842AF8F6-E143-494C-B275-F395220732FF@freebsd.org> Date: Tue, 24 Sep 2013 16:04:18 +0400 Message-ID: Subject: Re: panic: make_dev_credv: bad si_name (error=17, si_name=iscsi) From: Sergey Kandaurov To: =?ISO-8859-2?Q?Edward_Tomasz_Napiera=B3a?= Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: quoted-printable 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 12:04:21 -0000 On 24 September 2013 15:44, Edward Tomasz Napiera=B3a w= rote: > 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, >>>> >>>> today I tried to play a bit with new iscsi >>>> >>>> r255812 isn't fully complete fix? >>>> >>> [...] >>>> run `kldload iscsi_initiator` and got a panic: >>> >>> Something like this quick'n'dirty should work. >>> Compile tested only. >>> >>> 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); >>> >>> 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); >> >> 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); > > 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_WH= EEL, 0600, "iscsi"); > - isc->dev->si_drv1 =3D isc; > + isc->dev =3D make_dev_credf(MAKEDEV_CHECKNAME, &iscsi_cdevsw, max_s= essions, > + 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); > > TAILQ_INIT(&isc->isc_sess); > LGTM, except there is different indentation where for function calls each new line aligned with the first function argument. --=20 wbr, pluknet