[PATCH] [MTD-UTILS] Bad block handling in nandwrite when reading from standard input

Artem Bityutskiy dedekind at infradead.org
Tue Jun 9 08:53:03 EDT 2009

On Mon, 2009-06-08 at 15:32 -0700, Jehan Bing wrote:
> Nandwrite tries to use lseek() when failing to write on a page. lseek() will fail when used on the standard input so nandwrite fails. This code replaces lseek with a buffer.
> When the data is read, it is put in a buffer (filebuf). This buffer is reset at each block boundary. So a "seek" just means reading from the beginning of the buffer. writebuf and oobreadbuf are now just pointers to locations in filebuf.
> With this change, reading from stdin or from a file now uses the same code path.
> Signed-off-by: Jehan Bing <jehan at orb.com>

Too large patch for me to review. Could you split it on few smaller
ones please?

Also, please, do not send e-mails with
lines. Please, wrap them to 78 characters. You'll make it then
easier for other people to deal with you. Let's be nice.

Best regards,
Artem Bityutskiy (Битюцкий Артём)

More information about the linux-mtd mailing list