In the Linux kernel, the following vulnerability has been resolved: fsnotify: clear PARENT_WATCHED flags lazily In some setups directories can have many (usually negative) dentries. Hence __fsnotifyupdatechilddentryflags() function can take a significant amount of time. Since the bulk of this function happens under inode->i_lock this causes a significant contention on the lock when we remove the watch from the directory as the __fsnotifyupdatechilddentryflags() call from fsnotifyrecalcmask() races with __fsnotifyupdatechilddentryflags() calls from __fsnotifyparent() happening on children. This can lead upto softlockup reports reported by users. Fix the problem by calling fsnotifyupdatechildrendentryflags() to set PARENTWATCHED flags only when parent starts watching children. When parent stops watching children, clear false positive PARENT_WATCHED flags lazily in _fsnotifyparent() for each accessed child.