targetctl restore and OSError: [Errno 22] Invalid argument

Jerome Martin tramjoe.merin at gmail.com
Fri Apr 18 14:51:30 UTC 2014


Hi Andy,

On 04/15/2014 07:44 PM, Andy Grover wrote:
> On 04/14/2014 06:05 AM, Krzysztof Chojnowski wrote:
[...]
>> Is it kernel or targetcli-fb issue?
>
> Thanks for your investigation.
>
> It is both.
>
> There's some questionable exception-catching code in rtslib-fb (the
> library targetcli-fb uses) and then in the kernel -- userspace expects
> to be able to always set attributes to the value we read (and saved) but
> this is not the case for the new pi_prot_type attribute.
>
> I'll fix up rtslib-fb and hopefully post the trivial fix for the kernel
> today, as well.

Thanks Andy and Krzysztof for reporting this.
Even though I think that exception other than IOError should not really 
happen when writing parameters and attributes, I agree that it is still 
a good thing to catch a broader range of exceptions here in rtslib.

I pushed a patch to rtslib mainline to that effect, catching every 
exception there, similar to what you now do for the rtslib-fb (BTW, 
double check your patch, there is a copy/paste typo in it, you raise 
"Cannot set attribute" in set_parameter() ;-) ).

Best Regards,
--
Jerome Martin


More information about the targetcli-fb-devel mailing list