Showing error 1156

User: Jiri Slaby
Error type: Double Lock
Error type description: Some lock is locked twice unintentionally in a sequence
File location: mm/swapfile.c
Line in file: 255
Project: Linux Kernel
Project version: 2.6.28
Tools: Stanse (1.2)
Entered: 2012-04-29 14:49:11 UTC


Source:

 225                nr_swap_pages--;
 226                offset = scan_swap_map(si);
 227                if (offset) {
 228                        spin_unlock(&swap_lock);
 229                        return swp_entry(type, offset);
 230                }
 231                nr_swap_pages++;
 232        }
 233        spin_unlock(&swap_lock);
 234        return (swp_entry_t) {0};
 235}
 236
 237static struct swap_info_struct * swap_info_get(swp_entry_t entry)
 238{
 239        struct swap_info_struct * p;
 240        unsigned long offset, type;
 241
 242        if (!entry.val)
 243                goto out;
 244        type = swp_type(entry);
 245        if (type >= nr_swapfiles)
 246                goto bad_nofile;
 247        p = & swap_info[type];
 248        if (!(p->flags & SWP_USED))
 249                goto bad_device;
 250        offset = swp_offset(entry);
 251        if (offset >= p->max)
 252                goto bad_offset;
 253        if (!p->swap_map[offset])
 254                goto bad_free;
 255        spin_lock(&swap_lock);
 256        return p;
 257
 258bad_free:
 259        printk(KERN_ERR "swap_free: %s%08lx\n", Unused_offset, entry.val);
 260        goto out;
 261bad_offset:
 262        printk(KERN_ERR "swap_free: %s%08lx\n", Bad_offset, entry.val);
 263        goto out;
 264bad_device:
 265        printk(KERN_ERR "swap_free: %s%08lx\n", Unused_file, entry.val);
Show full sources