[U-Boot] [PATCH] UBIFS: Change ubifsload to not read beyond the requested size

Ben Gardiner bengardiner at nanometrics.ca
Fri Oct 29 16:01:18 CEST 2010


On Fri, Oct 29, 2010 at 5:04 AM, Stefan Roese <sr at denx.de> wrote:
> Until now ubifsload pads the destination with 0 up to a multiple of
> UBIFS_BLOCK_SIZE (4KiB) while reading a file to memory. This patch
> changes this behaviour to only read to the requested length. This
> is either the file length or the length/size provided as parameter
> to the ubifsload command.
>
> Signed-off-by: Stefan Roese <sr at denx.de>
> ---
> [...]
> +                       /*
> +                        * Reading last block? Make sure to not write beyond
> +                        * the requested size.
> +                        */
s/write/read/

> [...]
> +                               /* Read block-siez into temp buffer */
s/siez/size/

Applies to 908614f20f7f0f5df736eed21b88e81ebbf14e86 of
git://git.denx.de/u-boot.git.

One checkpatch warning:

WARNING: line over 80 characters
#134: FILE: fs/ubifs/ubifs.c:615:
+                                * last block. This is to not pad the
destination

total: 0 errors, 1 warnings, 88 lines checked

Tested on da850evm with NAND, env.oob enabled. Loaded a uImage from
ubifs and booted it.

Tested-by: Ben Gardiner <bengardiner at nanometrics.ca>

Best Regards,
Ben Gardiner

---
Nanometrics Inc.
http://www.nanometrics.ca


More information about the U-Boot mailing list