Showing error 1197

User: Jiri Slaby
Error type: Double Unlock
Error type description: Some lock is unlocked twice unintentionally in a sequence
File location: fs/jffs2/wbuf.c
Line in file: 747
Project: Linux Kernel
Project version: 2.6.28
Tools: Stanse (1.2)
Entered: 2012-04-30 10:52:00 UTC


Source:

 717                /* retry flushing wbuf in case jffs2_wbuf_recover
 718                   left some data in the wbuf */
 719                if (ret)
 720                        ret = __jffs2_flush_wbuf(c, PAD_ACCOUNTING);
 721                up_write(&c->wbuf_sem);
 722        } else while (old_wbuf_len &&
 723                      old_wbuf_ofs == c->wbuf_ofs) {
 724
 725                mutex_unlock(&c->alloc_sem);
 726
 727                D1(printk(KERN_DEBUG "jffs2_flush_wbuf_gc() calls gc pass\n"));
 728
 729                ret = jffs2_garbage_collect_pass(c);
 730                if (ret) {
 731                        /* GC failed. Flush it with padding instead */
 732                        mutex_lock(&c->alloc_sem);
 733                        down_write(&c->wbuf_sem);
 734                        ret = __jffs2_flush_wbuf(c, PAD_ACCOUNTING);
 735                        /* retry flushing wbuf in case jffs2_wbuf_recover
 736                           left some data in the wbuf */
 737                        if (ret)
 738                                ret = __jffs2_flush_wbuf(c, PAD_ACCOUNTING);
 739                        up_write(&c->wbuf_sem);
 740                        break;
 741                }
 742                mutex_lock(&c->alloc_sem);
 743        }
 744
 745        D1(printk(KERN_DEBUG "jffs2_flush_wbuf_gc() ends...\n"));
 746
 747        mutex_unlock(&c->alloc_sem);
 748        return ret;
 749}
 750
 751/* Pad write-buffer to end and write it, wasting space. */
 752int jffs2_flush_wbuf_pad(struct jffs2_sb_info *c)
 753{
 754        int ret;
 755
 756        if (!c->wbuf)
 757                return 0;
Show full sources