[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: JFFS2 stuck again.



 
>On Tue, 10 Apr 2001, Vipin Malik wrote:

>> Ok, this is what I got (runnig the stuff through ksymoops):

>jffs2_gcd_mtd1  D C11442C4     0     8      1        (L-TLB)       9
>7
>Call Trace: [<c0107a0d>] [<c0107b74>] [<c01fffbb>] [<c01774ad>]
><c014190c>] [<e0011985>] [<e88b1196>]
>      [<c0176f22>] [<c0179085>] [<edcba987>] [<edcba987>] [<edcba987>]
><edcba987>] [<c0109005>] [<c0178eb0>]
>      [<c010748a>] [<c0107493>]


>>Trace; c0107a0d <__down+5d/b0>
>>Trace; c0107b74 <__down_failed+8/c>
>>Trace; c01fffbb <stext_lock+dab/13c8>
>>Trace; c01774ad <jffs2_garbage_collect_dirent+13d/1d0>
>>Trace; c014190c <iget4+4c/e0>
>>Trace; e0011985 <END_OF_CODE+1fd73791/????>
>>Trace; e88b1196 <END_OF_CODE+28612fa2/????>
>>Trace; c0176f22 <jffs2_garbage_collect_pass+332/420>
>>Trace; c0179085 <jffs2_garbage_collect_thread+1d5/1e0>
>>Trace; edcba987 <END_OF_CODE+2da1c793/????>
>>Trace; edcba987 <END_OF_CODE+2da1c793/????>
>>Trace; edcba987 <END_OF_CODE+2da1c793/????>
>>Trace; edcba987 <END_OF_CODE+2da1c793/????>
>>Trace; c0109005 <reschedule+5/10>
>>Trace; c0178eb0 <jffs2_garbage_collect_thread+0/1e0>
>>Trace; c010748a <kernel_thread+1a/30>
>>Trace; c0107493 <kernel_thread+23/30>

>ldconfig  D C3F666D4     0    18     10        (NOTLB)
>Call Trace: [<c0107a0d>] [<c0107b74>] [<c01ffdd1>] [<c0139040>]
>[<c01391bc>] [<c012d970>] [<d851f8bb>]
>       [<c012dc88>] [<c0108f13>]

>> Trace; c0107a0d <__down+5d/b0>
>> Trace; c0107b74 <__down_failed+8/c>
>> Trace; c01ffdd1 <stext_lock+bc1/13c8>
>> Trace; c0139040 <vfs_create+90/c0>
>> Trace; c01391bc <open_namei+14c/5b0>
>> Trace; c012d970 <filp_open+30/50>
>> Trace; d851f8bb <END_OF_CODE+182816c7/????>
>> Trace; c012dc88 <sys_open+38/c0>
>> Trace; c0108f13 <system_call+33/40>

>OK,... looks like both of them are waiting for a locked semaphore. Which
>has to be the alloc_sem. One is calling jffs2_reserve_space_gc() from
>jffs2_garbage_collect_dirent(), and the other is calling
>jffs2_reserve_space() from jffs2_create().

>The jffs2_reserve_space* functions don't show up on the call trace
>because 
>of the way the down() call works, I believe. Not sure why jffs2_create()

>hasn't shown up though.

>If they're both waiting on the alloc_sem, then it looks like it's been 
>obtained somewhere and not released. That would probably have to be in
>an 
>error path or it would happen far more often - but error paths would 
>normally whinge about whatever went wrong. 

>Could you confirm the exact locations in the code of offset c01774ad 
><jffs2_garbage_collect_dirent+13d/1d0>, please? Add 'EXTRA_CFLAGS := -g'

>to the fs/jffs2 Makefile if it's not already there, rebuild exactly the 
>same kernel, then 'gdb vmlinux' and 'list *0xc01774ad'.


Ok, this is what I got:

(gdb) list *0xc01774ad
0xc01774ad is in jffs2_garbage_collect_dirent (gc.c:360).
355             rd.mctime = max(inode->i_mtime, inode->i_ctime);
356             rd.type = fd->type;
357             rd.node_crc = crc32(0, &rd, sizeof(rd)-8);
358             rd.name_crc = crc32(0, fd->name, rd.nsize);
359
360             ret = jffs2_reserve_space_gc(c, sizeof(rd)+rd.nsize,
&phys_ofs, &alloclen);
361             if (ret) {
362                     printk(KERN_WARNING "jffs2_reserve_space_gc of %d
bytes for garbage_collect_dirent failed: %d\n",
363                            sizeof(rd)+rd.nsize, ret);
364                     return ret;


Looks like you were right!

One quick question though: How did you know that the call from
ldconfig was for the same semaphore? There is no mention of
any such call there? Did the "vfs_create(), open_namei() and filep_open()"
clue you in as that (probably) has to go to the JFFS2 as those would work on
the root fs (which is JFFS2)? TIA. 


>Assuming this confirms that it's the call to jffs2_reserve_space_gc() at
>line 360 of gc.c, then someone who isn't on vacation needs to go through
>the code looking for all instances of jffs2_reserve_space{_gc,} and
>ensuring that jffs2_complete_reservation() is correctly called in all
>circumstances where the reserve_space function succeeded.

I can *attempt* to do that, but please, let that attempt not stop anyone
else from doing it too. Two independent efforts are likely to catch what my
novice attempts may miss.

Vipin



To unsubscribe from this list: send the line "unsubscribe jffs-dev" in
the body of a message to majordomo@xxxxxxx.com