Showing error 893

User: Jiri Slaby
Error type: Double Lock
Error type description: Some lock is locked twice unintentionally in a sequence
File location: fs/namespace.c
Line in file: 279
Project: Linux Kernel
Project version: 2.6.28
Tools: Undetermined 1
Stanse (1.2)
Entered: 2012-02-27 21:22:42 UTC


Source:

 249 * the write operation is finished, mnt_drop_write()
 250 * must be called.  This is effectively a refcount.
 251 */
 252int mnt_want_write(struct vfsmount *mnt)
 253{
 254        int ret = 0;
 255        struct mnt_writer *cpu_writer;
 256
 257        cpu_writer = &get_cpu_var(mnt_writers);
 258        spin_lock(&cpu_writer->lock);
 259        if (__mnt_is_readonly(mnt)) {
 260                ret = -EROFS;
 261                goto out;
 262        }
 263        use_cpu_writer_for_mount(cpu_writer, mnt);
 264        cpu_writer->count++;
 265out:
 266        spin_unlock(&cpu_writer->lock);
 267        put_cpu_var(mnt_writers);
 268        return ret;
 269}
 270EXPORT_SYMBOL_GPL(mnt_want_write);
 271
 272static void lock_mnt_writers(void)
 273{
 274        int cpu;
 275        struct mnt_writer *cpu_writer;
 276
 277        for_each_possible_cpu(cpu) {
 278                cpu_writer = &per_cpu(mnt_writers, cpu);
 279                spin_lock(&cpu_writer->lock);
 280                __clear_mnt_count(cpu_writer);
 281                cpu_writer->mnt = NULL;
 282        }
 283}
 284
 285/*
 286 * These per-cpu write counts are not guaranteed to have
 287 * matched increments and decrements on any given cpu.
 288 * A file open()ed for write on one cpu and close()d on
 289 * another cpu will imbalance this count.  Make sure it
Show full sources