User: | Jiri Slaby |
Error type: | Double Lock |
Error type description: | Some lock is locked twice unintentionally in a sequence |
File location: | fs/super.c |
Line in file: | 343 |
Project: | Linux Kernel |
Project version: | 2.6.28 |
Tools: |
Undetermined 1
Clang Static Analyzer (3.0) |
Entered: | 2012-02-27 21:22:42 UTC |
313 unlock_kernel(); 314 unlock_super(sb); 315 } 316 spin_lock(&sb_lock); 317 /* should be initialized for __put_super_and_need_restart() */ 318 list_del_init(&sb->s_list); 319 list_del(&sb->s_instances); 320 spin_unlock(&sb_lock); 321 up_write(&sb->s_umount); 322} 323 324EXPORT_SYMBOL(generic_shutdown_super); 325 326/** 327 * sget - find or create a superblock 328 * @type: filesystem type superblock should belong to 329 * @test: comparison callback 330 * @set: setup callback 331 * @data: argument to each of them 332 */ 333struct super_block *sget(struct file_system_type *type, 334 int (*test)(struct super_block *,void *), 335 int (*set)(struct super_block *,void *), 336 void *data) 337{ 338 struct super_block *s = NULL; 339 struct super_block *old; 340 int err; 341 342retry: 343 spin_lock(&sb_lock); 344 if (test) { 345 list_for_each_entry(old, &type->fs_supers, s_instances) { 346 if (!test(old, data)) 347 continue; 348 if (!grab_super(old)) 349 goto retry; 350 if (s) 351 destroy_super(s); 352 return old; 353 }