Commit d1932cd5 authored by Anton Blanchard's avatar Anton Blanchard Committed by Simon Horman
Browse files

kexec/fs2dt: Use slurp_file_len to avoid partial read of files



The OPAL firmware is going to embed its symbol map in the device tree.
The size is large enough to be more than a page, and it takes
multiple reads to get the whole file. This is because sysfs uses
the seq_file helpers which do a page at a time.

Unfortunately fs2dt has no handling for short reads and we die with:

unrecoverable error: short read from"/proc/device-tree//ibm,opal/firmware/symbol-map"

This patch uses the slurp_file_len helper which does the right thing.
It moves the explicit open of the file further down for
add_usable_mem_property and add_dyn_reconf_usable_mem_property.
We should convert both of these to use the buffer provided by
slurp_file_len at some stage.

Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
Signed-off-by: default avatarSimon Horman <horms@verge.net.au>
parent 6a180944
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment