User: | Jiri Slaby |
Error type: | Double Unlock |
Error type description: | Some lock is unlocked twice unintentionally in a sequence |
File location: | fs/jffs2/gc.c |
Line in file: | 343 |
Project: | Linux Kernel |
Project version: | 2.6.28 |
Tools: |
Stanse
(1.2)
|
Entered: | 2012-04-30 10:52:00 UTC |
313 */ 314 315 switch(ic->state) { 316 case INO_STATE_CHECKEDABSENT: 317 /* It's been checked, but it's not currently in-core. 318 We can just copy any pristine nodes, but have 319 to prevent anyone else from doing read_inode() while 320 we're at it, so we set the state accordingly */ 321 if (ref_flags(raw) == REF_PRISTINE) 322 ic->state = INO_STATE_GC; 323 else { 324 D1(printk(KERN_DEBUG "Ino #%u is absent but node not REF_PRISTINE. Reading.\n", 325 ic->ino)); 326 } 327 break; 328 329 case INO_STATE_PRESENT: 330 /* It's in-core. GC must iget() it. */ 331 break; 332 333 case INO_STATE_UNCHECKED: 334 case INO_STATE_CHECKING: 335 case INO_STATE_GC: 336 /* Should never happen. We should have finished checking 337 by the time we actually start doing any GC, and since 338 we're holding the alloc_sem, no other garbage collection 339 can happen. 340 */ 341 printk(KERN_CRIT "Inode #%u already in state %d in jffs2_garbage_collect_pass()!\n", 342 ic->ino, ic->state); 343 mutex_unlock(&c->alloc_sem); 344 spin_unlock(&c->inocache_lock); 345 BUG(); 346 347 case INO_STATE_READING: 348 /* Someone's currently trying to read it. We must wait for 349 them to finish and then go through the full iget() route 350 to do the GC. However, sometimes read_inode() needs to get 351 the alloc_sem() (for marking nodes invalid) so we must 352 drop the alloc_sem before sleeping. */ 353