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: | 1534 |
Project: | Linux Kernel |
Project version: | 2.6.28 |
Tools: |
Undetermined 1
|
Entered: | 2012-03-04 17:07:06 UTC |
1504 * - unhash this dentry and free it. 1505 * 1506 * Usually, we want to just turn this into 1507 * a negative dentry, but if anybody else is 1508 * currently using the dentry or the inode 1509 * we can't do that and we fall back on removing 1510 * it from the hash queues and waiting for 1511 * it to be deleted later when it has no users 1512 */ 1513 1514/** 1515 * d_delete - delete a dentry 1516 * @dentry: The dentry to delete 1517 * 1518 * Turn the dentry into a negative dentry if possible, otherwise 1519 * remove it from the hash queues so it can be deleted later 1520 */ 1521 1522void d_delete(struct dentry * dentry) 1523{ 1524 int isdir = 0; 1525 /* 1526 * Are we the only user? 1527 */ 1528 spin_lock(&dcache_lock); 1529 spin_lock(&dentry->d_lock); 1530 isdir = S_ISDIR(dentry->d_inode->i_mode); 1531 if (atomic_read(&dentry->d_count) == 1) { 1532 dentry_iput(dentry); 1533 fsnotify_nameremove(dentry, isdir); 1534 return; 1535 } 1536 1537 if (!d_unhashed(dentry)) 1538 __d_drop(dentry); 1539 1540 spin_unlock(&dentry->d_lock); 1541 spin_unlock(&dcache_lock); 1542 1543 fsnotify_nameremove(dentry, isdir); 1544}