Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Sep 2013 18:06:01 +0200
From:      =?iso-8859-2?Q?Edward_Tomasz_Napiera=B3a?= <trasz@freebsd.org>
To:        Sergey Kandaurov <pluknet@gmail.com>
Cc:        "Sergey V. Dyatko" <sergey.dyatko@gmail.com>, current Current <current@freebsd.org>
Subject:   Re: panic: make_dev_credv: bad si_name (error=17, si_name=iscsi)
Message-ID:  <F82E3854-76B3-433C-B26B-8ACC3358CB07@freebsd.org>
In-Reply-To: <CAE-mSOLfm8rZZKLqp=U3Xid_3YtsX4ZUT_S6K=m7Kxkr1G3bTA@mail.gmail.com>
References:  <20130924104658.46313090@laptop.minsk.domain> <CAE-mSO%2BfWdySa%2BO6kuSe-z9AQsi0TNFy7LMrgx-btUJfQhx=jw@mail.gmail.com> <CAE-mSOKpNMV9PWR-Z2geS889aSbaBiTZavdDmvaxwx6U4_7EPw@mail.gmail.com> <842AF8F6-E143-494C-B275-F395220732FF@freebsd.org> <CAE-mSOLfm8rZZKLqp=U3Xid_3YtsX4ZUT_S6K=m7Kxkr1G3bTA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Wiadomo=B6=E6 napisana przez Sergey Kandaurov <pluknet@gmail.com> w dniu =
24 wrz 2013, o godz. 14:04:
> On 24 September 2013 15:44, Edward Tomasz Napiera=B3a =
<trasz@freebsd.org> wrote:
>> Wiadomo=B6=E6 napisana przez Sergey Kandaurov <pluknet@gmail.com> w =
dniu 24 wrz 2013, o godz. 13:00:
>>> On 24 September 2013 14:40, Sergey Kandaurov <pluknet@gmail.com> =
wrote:
>>>> On 24 September 2013 11:46, Sergey V. Dyatko =
<sergey.dyatko@gmail.com> 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!




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?F82E3854-76B3-433C-B26B-8ACC3358CB07>