User: | Jiri Slaby |
Error type: | Leaving function in locked state |
Error type description: | Some lock is not unlocked on all paths of a function, so it is leaked |
File location: | fs/dcache.c |
Line in file: | 444 |
Project: | Linux Kernel |
Project version: | 2.6.28 |
Tools: |
Undetermined 1
|
Entered: | 2012-03-04 17:07:06 UTC |
414 * the LRU list has already been removed. 415 * 416 * Try to prune ancestors as well. This is necessary to prevent 417 * quadratic behavior of shrink_dcache_parent(), but is also expected 418 * to be beneficial in reducing dentry cache fragmentation. 419 */ 420static void prune_one_dentry(struct dentry * dentry) 421 __releases(dentry->d_lock) 422 __releases(dcache_lock) 423 __acquires(dcache_lock) 424{ 425 __d_drop(dentry); 426 dentry = d_kill(dentry); 427 428 /* 429 * Prune ancestors. Locking is simpler than in dput(), 430 * because dcache_lock needs to be taken anyway. 431 */ 432 spin_lock(&dcache_lock); 433 while (dentry) { 434 if (!atomic_dec_and_lock(&dentry->d_count, &dentry->d_lock)) 435 return; 436 437 if (dentry->d_op && dentry->d_op->d_delete) 438 dentry->d_op->d_delete(dentry); 439 dentry_lru_del_init(dentry); 440 __d_drop(dentry); 441 dentry = d_kill(dentry); 442 spin_lock(&dcache_lock); 443 } 444} 445 446/* 447 * Shrink the dentry LRU on a given superblock. 448 * @sb : superblock to shrink dentry LRU. 449 * @count: If count is NULL, we prune all dentries on superblock. 450 * @flags: If flags is non-zero, we need to do special processing based on 451 * which flags are set. This means we don't need to maintain multiple 452 * similar copies of this loop. 453 */ 454static void __shrink_dcache_sb(struct super_block *sb, int *count, int flags)