Showing error 632

User: Jiri Slaby
Error type: Double Unlock
Error type description: Some lock is unlocked twice unintentionally in a sequence
File location: mm/filemap_xip.c
Line in file: 206
Project: Linux Kernel
Project version: 2.6.28
Tools: Stanse (1.2)
Entered: 2011-11-07 22:20:57 UTC


Source:

176        int locked = 0;
177
178        count = read_seqcount_begin(&xip_sparse_seq);
179
180        page = __xip_sparse_page;
181        if (!page)
182                return;
183
184retry:
185        spin_lock(&mapping->i_mmap_lock);
186        vma_prio_tree_foreach(vma, &iter, &mapping->i_mmap, pgoff, pgoff) {
187                mm = vma->vm_mm;
188                address = vma->vm_start +
189                        ((pgoff - vma->vm_pgoff) << PAGE_SHIFT);
190                BUG_ON(address < vma->vm_start || address >= vma->vm_end);
191                pte = page_check_address(page, mm, address, &ptl, 1);
192                if (pte) {
193                        /* Nuke the page table entry. */
194                        flush_cache_page(vma, address, pte_pfn(*pte));
195                        pteval = ptep_clear_flush_notify(vma, address, pte);
196                        page_remove_rmap(page, vma);
197                        dec_mm_counter(mm, file_rss);
198                        BUG_ON(pte_dirty(pteval));
199                        pte_unmap_unlock(pte, ptl);
200                        page_cache_release(page);
201                }
202        }
203        spin_unlock(&mapping->i_mmap_lock);
204
205        if (locked) {
206                mutex_unlock(&xip_sparse_mutex);
207        } else if (read_seqcount_retry(&xip_sparse_seq, count)) {
208                mutex_lock(&xip_sparse_mutex);
209                locked = 1;
210                goto retry;
211        }
212}
213
214/*
215 * xip_fault() is invoked via the vma operations vector for a
216 * mapped memory region to read in file data during a page fault.
Show full sources