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

Re: [Xen-devel] [PATCH] xen: stop_machine: fill fn_result only in case of error.



>>> On 30.05.17 at 18:19, <gregory.herrero@xxxxxxxxxx> wrote:
> Since fn_result member is shared across all cpus, it must be filled
> only if an error happens. Assume CPU1 detects an error and set fn_result
> to -1, then CPU2 doesn't detect an error and set fn_result to 0. The
> error detected by CPU1 will be ignored.

First of all there's a difference between stop_machine_run()'s last
argument being a valid CPU number or NR_CPUS - what you say
above applies to the latter case only, so you should also state that.

And then even after your fix it'll remain ambiguous which error is
being returned on case multiple failures occur (which isn't all that
unlikely). This (almost unavoidable) effect should also be spelled
out imo, and I think you want to use write_atomic() to actually
store the error code.

Finally there a various coding style violations in the code you add.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.