User: | Jiri Slaby |
Error type: | Calling function from invalid context |
Error type description: | Some function is called at inappropriate place like sleep inside critical sections or interrupt handlers |
File location: | fs/jffs2/fs.c |
Line in file: | 626 |
Project: | Linux Kernel |
Project version: | 2.6.28 |
Tools: |
Stanse
(1.2)
|
Entered: | 2011-11-07 22:19:02 UTC |
596 /* The inode has zero nlink but its nodes weren't yet marked 597 obsolete. This has to be because we're still waiting for 598 the final (close() and) iput() to happen. 599 600 There's a possibility that the final iput() could have 601 happened while we were contemplating. In order to ensure 602 that we don't cause a new read_inode() (which would fail) 603 for the inode in question, we use ilookup() in this case 604 instead of iget(). 605 606 The nlink can't _become_ zero at this point because we're 607 holding the alloc_sem, and jffs2_do_unlink() would also 608 need that while decrementing nlink on any inode. 609 */ 610 inode = ilookup(OFNI_BS_2SFFJ(c), inum); 611 if (!inode) { 612 D1(printk(KERN_DEBUG "ilookup() failed for ino #%u; inode is probably deleted.\n", 613 inum)); 614 615 spin_lock(&c->inocache_lock); 616 ic = jffs2_get_ino_cache(c, inum); 617 if (!ic) { 618 D1(printk(KERN_DEBUG "Inode cache for ino #%u is gone.\n", inum)); 619 spin_unlock(&c->inocache_lock); 620 return NULL; 621 } 622 if (ic->state != INO_STATE_CHECKEDABSENT) { 623 /* Wait for progress. Don't just loop */ 624 D1(printk(KERN_DEBUG "Waiting for ino #%u in state %d\n", 625 ic->ino, ic->state)); 626 sleep_on_spinunlock(&c->inocache_wq, &c->inocache_lock); 627 } else { 628 spin_unlock(&c->inocache_lock); 629 } 630 631 return NULL; 632 } 633 } else { 634 /* Inode has links to it still; they're not going away because 635 jffs2_do_unlink() would need the alloc_sem and we have it. 636 Just iget() it, and if read_inode() is necessary that's OK.