User: | Jiri Slaby |
Error type: | Double Unlock |
Error type description: | Some lock is unlocked twice unintentionally in a sequence |
File location: | fs/dcache.c |
Line in file: | 229 |
Project: | Linux Kernel |
Project version: | 2.6.28 |
Tools: |
Stanse
(1.2)
|
Entered: | 2011-11-07 22:20:57 UTC |
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 /* 234 * AV: ->d_delete() is _NOT_ allowed to block now. 235 */ 236 if (dentry->d_op && dentry->d_op->d_delete) { 237 if (dentry->d_op->d_delete(dentry)) 238 goto unhash_it; 239 }