[PATCH] flash_otp_write: fix writing to NAND in presence of partial reads

Artem Bityutskiy dedekind1 at gmail.com
Mon Mar 11 03:51:56 EDT 2013


On Thu, 2013-02-28 at 10:42 +0100, Uwe Kleine-König wrote:
> When doing something like:
> 
> 	{ printf "\xff"; printf "\xfe"; } | flash_otp_write -u /dev/mtd0 0
> 
> flash_otp_write might see only a single byte when reading from stdin for
> the first tim. In this case (and without this patch) it pads to
> $writesize with '\xff's and writes that out. In the next iteration it
> reads the 2nd byte, pads and writes again. So the 2nd byte is written to
> offset $writesize instead of 1.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>

Pushed both to mtd-utils.git, thanks!

-- 
Best Regards,
Artem Bityutskiy




More information about the linux-mtd mailing list