Re: [PATCH 7/7] libiscsi: fix iscsi pool error path

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Mike Christie (michaelc@xxxxxxxxxxx) wrote:
>>> -	if (q->queue == ERR_PTR(-ENOMEM))
>>> +	if (IS_ERR(q->queue)) {
>>
>> This indeed solves the problem I had underlined before, but
>> introduces a new one. Right now the only error returned by kfifo_init
>> is -ENOMEM. This may however change in the future, and then the
>> above code would silently convert the other error code to -ENOMEM.
>> This might make it difficult to trace errors.
>
> What do you mean by converting other errors codes to -ENOMEM?

Jean means the goto label...it will jump to essentially return -ENOMEM.

>> I know this is all just theoretical, at the moment your code is
>> correct, but I don't much like relying on assumptions which are not
>> guaranteed to last. So I would rather cleanly transmit the error code
>> up to the caller, or change the calling convention of kfifo_init() to
>
> What do you mean by cleanly transmitting the error code up the caller?

It's handwavy here...meaning if kfifo_init returned some other
error for some other condition, propagating that up the stack to the
iscsi_pool_init() caller.  Probably not all that critical to return
ENOMEM vs someother errno in this case.

thanks,
-chris
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux