Open himanshujha199640 opened 5 years ago
Note: marking the function with __releases_spinlock()
produces weird warnings(which seems reasonable because we are annotating it wrong):
/home/himanshu/clang-thread-safety-analysis/fs/dcache.c:862:1: warning: mutex '->d_lockref...lock' is not held on every path through
here [-Wthread-safety-analysis]
}
^
/home/himanshu/clang-thread-safety-analysis/fs/dcache.c:841:34: note: mutex acquired here
void dput(struct dentry *dentry) __releases_spinlock(dentry->d_lock)
^
/home/himanshu/clang-thread-safety-analysis/include/linux/compiler_attributes.h:264:50: note: expanded from macro '__releases_spinlock'
# define __releases_spinlock(x) __attribute__((release_capability(x)))
^
Interestingly, I don't understand why don't we get a warning like:
Mutex is not locked on every path through here..
?