Re: [PATCH v4 2/4] tools/bootconfig: Fix to check the write failure correctly

From: Steven Rostedt
Date: Thu Nov 19 2020 - 08:59:11 EST


On Thu, 19 Nov 2020 10:41:09 +0900
Masami Hiramatsu <mhiramat@xxxxxxxxxx> wrote:

> > If the first write fails (doesn't modify the initrd), and then this fails,
> > you will show a message of: "may be corrupted. Recommend to rebuild", when
> > that would not be the case. Should a test of the size be done again, to see
> > if it is already the same?
>
> Please see the above 2 write error check. You can find
>
> if (ret < 0)
> goto out;
>
> only in the first check. (I know, it might a bit misleadable)
> So, the first write is failed with error message, it doesn't call rollback.

Ah right, I missed check within the error check. I was only looking at the
first error and the goto at the end.

-- Steve