ClangBuiltLinux / thread-safety-analysis

A research project into applying Clang's Thread Safety Analysis to the Linux Kernel
Other
6 stars 0 forks source link

fs/dcache.c: can't annotate d_walk #127

Open himanshujha199640 opened 5 years ago

himanshujha199640 commented 5 years ago

Similar to: https://github.com/ClangBuiltLinux/thread-safety-analysis/issues/28#issuecomment-496215839

/home/himanshu/clang-thread-safety-analysis/fs/dcache.c:1277:9: warning: expecting mutex 'this_parent->d_lockref...lock' to be held at start of each loop [-Wthread-safety-analysis]
        next = this_parent->d_subdirs.next;
               ^
/home/himanshu/clang-thread-safety-analysis/fs/dcache.c:1263:2: note: mutex acquired here
        spin_lock(&this_parent->d_lock);
        ^
/home/himanshu/clang-thread-safety-analysis/fs/dcache.c:1294:4: warning: releasing mutex 'dentry->d_lockref...lock' that was not held [-Wthread-safety-analysis]
                        spin_unlock(&dentry->d_lock);
                        ^
/home/himanshu/clang-thread-safety-analysis/fs/dcache.c:1300:4: warning: releasing mutex 'dentry->d_lockref...lock' that was not held [-Wthread-safety-analysis]
                        spin_unlock(&dentry->d_lock);
                        ^
/home/himanshu/clang-thread-safety-analysis/fs/dcache.c:1311:3: warning: releasing mutex 'dentry->d_lockref...lock' that was not held [-Wthread-safety-analysis]
                spin_unlock(&dentry->d_lock);
                ^
/home/himanshu/clang-thread-safety-analysis/fs/dcache.c:1322:3: warning: releasing mutex 'child->d_lockref...lock' that was not held [-Wthread-safety-analysis]
                spin_unlock(&child->d_lock);
                ^
/home/himanshu/clang-thread-safety-analysis/fs/dcache.c:1323:3: warning: acquiring mutex 'this_parent->d_lockref...lock' that is already held [-Wthread-safety-analysis]
                spin_lock(&this_parent->d_lock);
                ^