[Stgt-devel] segmentation fault trying to update LUN 0 ...
Richard Sharpe
realrichardsharpe
Fri Jul 25 03:08:39 CEST 2008
On Thu, Jul 24, 2008 at 5:52 PM, Richard Sharpe
<realrichardsharpe at gmail.com> wrote:
> On Thu, Jul 24, 2008 at 2:29 PM, Tomasz Chmielewski <mangoo at wpkg.org> wrote:
>> Richard Sharpe schrieb:
>>>
>>> On Thu, Jul 24, 2008 at 1:12 PM, Richard Sharpe
>>> <realrichardsharpe at gmail.com> wrote:
>>>>
>>>> Hi,
>>>>
>>>> I was trying to add backing store to LUN 0 with this command and got a
>>>> segmentation fault:
>>>>
>>>> ./tgtadm --lld iscsi --op update --mode target --tid 1 --lun 0 -b
>>>> /root/data/hd_block
>>>> Segmentation fault
>>>>
>>>> Is it forbidden to use LUN 0? Here is what a SHOW shows ...
>>>
>>> Sigh, ignore me. The syntax was wrong!
>>
>> It shouldn't segfault anyway, should it?
>
> It seems the segfault is in an error path:
>
> ./tgtadm --lld iscsi --op update --mode target --tid 1 --lun 0 -b
> /root/data/hd_block
> tgtadm: err no: 4294967274
> Segmentation fault
>
> This is in ipc_mgmt_rsp:
>
> if (rsp.err != TGTADM_SUCCESS) {
> eprintf("err no: %u\n", rsp.err);
> eprintf("%s\n", tgtadm_emsg[rsp.err]);
> return EINVAL;
> }
>
> So, looks like tgtd is returning -22 somewhere ... instead of turning
> it into a positive error no.
Yes, in the iscsi driver code, iscsi_target_update is returning
-ENOENT and -EINVAL.
These return codes are wrong. It should return a correct
tgtadm_errno.h return code.
More information about the stgt
mailing list