[PATCH mtd-utils] nanddump: check write function result for errors

Rafał Miłecki zajec5 at gmail.com
Mon Jul 18 07:51:47 PDT 2016


On 18 July 2016 at 16:10, Richard Weinberger <richard at nod.at> wrote:
> Rafał,
>
> Am 18.07.2016 um 13:59 schrieb Rafał Miłecki:
>> On 18 July 2016 at 13:33, Richard Weinberger
>> <richard.weinberger at gmail.com> wrote:
>>> On Mon, Jul 18, 2016 at 11:18 AM, Rafał Miłecki <zajec5 at gmail.com> wrote:
>>>> Errors may happen, it's e.g. easy on embedded devices to run out of space
>>>> when dumping big partitions. This patch adds a helper function for
>>>> writing. It deals with partial writes and just returns 0 on success or
>>>> error number.
>>>>
>>>> The old code didn't check for errors at all which could result in
>>>> incomplete dumps without exiting with an error.
>>>
>>> Is this patch different from my version, does it fix more?
>>> http://lists.infradead.org/pipermail/linux-mtd/2016-April/067234.html
>>>
>>> Brian, if this is fine with you I'd apply one of these patches.
>>
>> I wasn't aware of your patch, having it accepted would save me some
>> time for sure.
>>
>> Two minor advantages I see in my version:
>> 1) It handles partial writes, just retries if only some part of buffer
>> has been written
>
> That's a plus point. :-)
>
>> 2) It displays error number and string which may provide some extra
>> hint to the user
>
> My patch too since it uses mtd-util's logging functions.
> sys_errmsg(...)
>
> Could you please merge both patches and resend?

Oh, I didn't realize sys_errmsg does that. I assumed it logs into
system log (which seemed like a weird idea to do). A bit confusing
name. Thanks, I'll send V2.

-- 
Rafał



More information about the linux-mtd mailing list