User: | Jiri Slaby |
Error type: | Double Lock |
Error type description: | Some lock is locked twice unintentionally in a sequence |
File location: | fs/dcache.c |
Line in file: | 223 |
Project: | Linux Kernel |
Project version: | 2.6.28 |
Tools: |
Undetermined 1
Clang Static Analyzer (3.0) |
Entered: | 2012-02-27 21:22:42 UTC |
193 * However, that implies that we have to traverse the dentry 194 * tree upwards to the parents which might _also_ now be 195 * scheduled for deletion (it may have been only waiting for 196 * its last child to go away). 197 * 198 * This tail recursion is done by hand as we don't want to depend 199 * on the compiler to always get this right (gcc generally doesn't). 200 * Real recursion would eat up our stack space. 201 */ 202 203/* 204 * dput - release a dentry 205 * @dentry: dentry to release 206 * 207 * Release a dentry. This will drop the usage count and if appropriate 208 * call the dentry unlink method as well as removing it from the queues and 209 * releasing its resources. If the parent dentries were scheduled for release 210 * they too may now get deleted. 211 * 212 * no dcache lock, please. 213 */ 214 215void dput(struct dentry *dentry) 216{ 217 if (!dentry) 218 return; 219 220repeat: 221 if (atomic_read(&dentry->d_count) == 1) 222 might_sleep(); 223 if (!atomic_dec_and_lock(&dentry->d_count, &dcache_lock)) 224 return; 225 226 spin_lock(&dentry->d_lock); 227 if (atomic_read(&dentry->d_count)) { 228 spin_unlock(&dentry->d_lock); 229 spin_unlock(&dcache_lock); 230 return; 231 } 232 233 /*