Nandwrite's behavior in case of write failure

Nahor nahor.j+gmane at gmail.com
Thu Jun 4 21:23:39 EDT 2009


Hi,

If the call to pwrite fails, nanwrite tries first to erase the block 
then to mark it as bad. If erase fails, nandwrite aborts. If setting the 
bad block flag fails, nandwrite just ignores it and go to the next block.

My questions are:
- Why erase the block?
- Probably linked to the first question, why abort if erase fails? Why 
not just ignore it and rely on the bad block flag?
- Why ignore the bad block flag error? If nandwrite can't set it and 
just goes on, the caller (app ou user) will think that everything is 
good. But when reading the partition later, the user will garbage when 
reaching that page.


Thanks,
	Nahor




More information about the linux-mtd mailing list