[PATCH] fs: Fix can_lseek_backward()

Sascha Hauer s.hauer at pengutronix.de
Fri Nov 17 00:57:54 PST 2017


On Wed, Nov 15, 2017 at 02:27:53PM -0800, Andrey Smirnov wrote:
> To quote corresponding man page:
> 
> "... Upon successful completion, lseek() returns the resulting offset
> location as measured in bytes from the beginning of the file."
> 
> Which for lseek(fd, 0, SEEK_SET) would be 0, so returning 'ret' as
> final step of the function would mean it'd never return anything but 0
> as well. Change the code to explicitly return '1' to fix the problem.
> 
> Fixes: 7c3f8d366 ("uimage: fix: add can_lseek_backward and use in uimage_open")
> Cc: Michael Grzeschik <m.grzeschik at pengutronix.de>
> Signed-off-by: Andrey Smirnov <andrew.smirnov at gmail.com>
> ---
> 
> Sascha:
> 
> This change should probably also go to master, since without enabling
> TFTP would break 'bootm' for uImages (at least it does on my setup)

Yes, applied to master. I also created a stable/v2017.11 branch.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list