public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* mtd-utils/nandwrite: what if write fails?
@ 2006-10-17 14:17 Ricard Wanderlof
  2006-10-17 14:36 ` Artem Bityutskiy
  2006-10-17 15:33 ` Josh Boyer
  0 siblings, 2 replies; 7+ messages in thread
From: Ricard Wanderlof @ 2006-10-17 14:17 UTC (permalink / raw)
  To: Linux mtd

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1201 bytes --]


I have a question regarding writes to NAND flash; for instance, in 
mtd-utils/nandwrite.c, prior to writing to a block, it is checked so that 
it isn't bad (using the MEMGETBADBLOCK ioctl). However, what happens if 
the block goes bad during write? If the pwrite() call which writes out the 
page data fails, the application says perror() and exits. Shouldn't it 
mark the block as bad, and re-write the data so far written to the block 
to the next good block? As I understand it, mtd doesn't mark a block bad, 
it is up to the application or overlying file system (e.g. JFFS2). So it 
won't even help to run nandwrite again as the block has not been marked 
bad.

Or have I missed something here?

(Or is it simply that normally nandwrite is only used during testing, or 
writing an initial filesystem, and the likelyhood of a block failing at 
precisely this time is rather small, compared to the rest of the lifetime 
of the memory (i.e. repeated JFFS2 accesses)?)

/Ricard
--
Ricard Wolf Wanderlöf                           ricardw(at)axis.com
Axis Communications AB, Lund, Sweden            www.axis.com
Phone +46 46 272 2016                           Fax +46 46 13 61 30

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2006-10-27 14:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-17 14:17 mtd-utils/nandwrite: what if write fails? Ricard Wanderlof
2006-10-17 14:36 ` Artem Bityutskiy
2006-10-27 13:07   ` Ricard Wanderlof
2006-10-27 14:13     ` Artem Bityutskiy
2006-10-17 15:33 ` Josh Boyer
2006-10-18  8:18   ` Ricard Wanderlof
2006-10-27 13:09   ` Ricard Wanderlof

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox