From: Michal Suchanek <hidden> Date: 2017-06-26 14:06:36
When fadump is already registered return success.
Currently EEXIST is returned which is difficult to handle race-free in
userspace when shell scripts are used. If multiple writers are trying to
write '1' there is no difference in whichever succeeds so just return 0
to all.
Signed-off-by: Michal Suchanek <redacted>
---
arch/powerpc/kernel/fadump.c | 1 -
1 file changed, 1 deletion(-)
From: Michal Suchanek <hidden> Date: 2017-06-26 14:06:46
Currently sysfs store handlers in fadump use if buf[0] == 'char'.
This means input "100foo" is interpreted as '1' and "01" as '0'.
Change to kstrtoint so leading zeroes and the like is handled in
expected way.
Signed-off-by: Michal Suchanek <redacted>
---
arch/powerpc/kernel/fadump.c | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
From: Michal Suchánek <hidden> Date: 2017-06-27 09:31:14
On Mon, 26 Jun 2017 16:06:00 +0200
Michal Suchanek [off-list ref] wrote:
quoted hunk
When fadump is already registered return success.
Currently EEXIST is returned which is difficult to handle race-free in
userspace when shell scripts are used. If multiple writers are trying
to write '1' there is no difference in whichever succeeds so just
return 0 to all.
Signed-off-by: Michal Suchanek <redacted>
---
arch/powerpc/kernel/fadump.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/arch/powerpc/kernel/fadump.c
b/arch/powerpc/kernel/fadump.c index 436aedf195ab..5a7355381dac 100644
kobject *kobj, break;
case '1':
if (fw_dump.dump_registered == 1) {
- ret = -EEXIST;
goto unlock_out;
}
/* Register Firmware-assisted dump */
Forget about this one.
It breaks another case when fadump is registered and you need to
re-register to account for change in system configuration.
Thanks
Michal
From: Hari Bathini <hidden> Date: 2017-11-12 17:30:22
Thanks for the patch, Michal.
On Monday 26 June 2017 07:36 PM, Michal Suchanek wrote:
Currently sysfs store handlers in fadump use if buf[0] == 'char'.
This means input "100foo" is interpreted as '1' and "01" as '0'.
Change to kstrtoint so leading zeroes and the like is handled in
expected way.
Signed-off-by: Michal Suchanek <redacted>
From: Michael Ellerman <hidden> Date: 2017-11-14 11:12:06
On Mon, 2017-06-26 at 14:06:01 UTC, Michal Suchanek wrote:
Currently sysfs store handlers in fadump use if buf[0] == 'char'.
This means input "100foo" is interpreted as '1' and "01" as '0'.
Change to kstrtoint so leading zeroes and the like is handled in
expected way.
Signed-off-by: Michal Suchanek <redacted>
Acked-by: Hari Bathini <redacted>
Signed-off-by: Michal Suchanek <a class="moz-txt-link-rfc2396E" href="mailto:msuchanek@suse.de"><msuchanek@suse.de></a></pre>