UBIFS errors when file-system is full

Brian Norris computersforpeace at gmail.com
Wed Sep 2 13:13:12 PDT 2015


On Wed, Sep 02, 2015 at 12:58:08PM -0700, Stefan Agner wrote:
> On 2015-08-31 18:43, Brian Norris wrote:
> > Why do you actually need to check the idle bit? If you need to read it
> > to clear out some FIFO, then that's fine -- just read it, but don't use
> > it as a second condition. The complete()/wait_for_completion()
> > synchronization should be sufficient on its own. (If not, then I think
> > you have other problems.)
> > 
> > The NFC_IRQ_STATUS-based condition looks like it could lead to races
> > because your interrupt may fire between setting and checking
> > the idle bit. So the IRQ handler will increment the completion struct
> > (cmd_done), but you *won't* be doing the corresponding decrement via
> > wait_for_completion(). If you don't do that... then the subsequent
> > wait_for_completion() will immediately succeed.
> 
> Tested over night and did some additional tests today, I did not see any
> issues for more than 2000 boots, so this really seems to fix the issue!

Awesome!

> Thanks Brian, will send out v12 soon.

Glad to help.

In case I didn't mention it already, I'm taking a closer look at Boris'
approach for this series:

http://lists.infradead.org/pipermail/linux-mtd/2015-August/061361.html

but your driver looks like a good candidate for using
nand_check_erased_ecc_chunk(), once we've agreed. Depenending on the
order of acceptance, I might like to get your driver converted either
before or after merging it. Shouldn't be too hard, though, as your
implementation looks very similar right now.

Brian



More information about the linux-mtd mailing list