JFFS2 : non-existent inode
AMUL KUMAR SAHA
amul.saha at samsung.com
Wed Mar 4 00:43:06 EST 2009
Environment : Flex-OneNAND 8Gb, Apollon Board, linux-2.6.26
I have just started with JFFS2 .
We were running fsstress on 5 Boards for 5 Days .
On 2 out of 5 boards, we observed the message "requestied to read an nonexistent ino",
On Repetition, the BUG seems to be random.
Dwelled inside the code and thought of a possible scenario for the occurence.
I found the following explanation to it, appropriate; to my minimal knowledge :
1) 2 or more processes(say, P1 and P2) handling GC(jffs2_gc_fetch_inode) enter the function jffs2_iget almost together, before getting a mutex_lock.
2) When a request for a lock is raised, one of the processes(P1) gets the mutex_lock(&f->sem) and the other one waits.
3) P1 deletes the inode-cache(f->inocache), and releases the lock.
4) Now, when P2 ends up calling jffs2_do_read_inode with 'inode->ino' available locally in that function (unaware of the fact that, this particular inode was just destroyed).
5) JFFS2-Error with the message "requestied to read an nonexistent ino" is displayed.
In the mean time, I have come up with my own fix to this situation. Just wanting to know if my explanation makes sense, so that I can go ahead with posting the patch in mailing-list.
Thanks and Regards,
Amul Kumar Saha
Memory Solutions Group
Samsung India Software Operations
More information about the linux-mtd