JFFS2 & SMP

Estelle HAMMACHE estelle.hammache at st.com
Thu Nov 4 04:03:59 EST 2004


Hello Artem,

as I mentionned before I don't have linux so I can't really test
your patch right now. I agree with the principle of your patch.
I believe it should work this way.
I was hoping the problem could be solved without introducing
a new mutex, however I didn't check all the functions which
modify the wbuf variables so I don't know whether it is a 
realistic idea or not.
bye
Estelle

"Artem B. Bityuckiy" wrote:
> 
> Hello Estelle.
> 
> It seems I now what is the problem. Thank you for your message.
> 
> The wbuf is protected by the alloc_sem because of all the writes go
> through the space reservation (or in case of GC, it also holds the
> alloc_sem).
> 
> When JFFS2 reads the flash, it also looks to the write buffer and if the
> NAND page which should be read is currently in the wbuf, it reads some
> data from the wbuf too. But there is no any protection there.
> 
> I've introduced the new read/write semaphore (wbuf_sem). It seems the
> problem is fixed, but I'm not sure yet.
> 
> Please, could you try the attached patch? The patch was made against the
> MTD snapshot of date 20041008
> (ftp://ftp.uk.linux.org/pub/people/dwmw2/mtd/cvs/mtd-snapshot-20041008.tar.bz2).
> 
> David, could you comment this?
>




More information about the linux-mtd mailing list