diff --git a/[refs] b/[refs] index c69c16b5339e..fc09766171d8 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 12783b002db1f02c29353c8f698a85514420b9f4 +refs/heads/master: 66055a4e7334b05354c835123ff621c5f700e56a diff --git a/trunk/fs/inotify.c b/trunk/fs/inotify.c index 1f50302849c5..7d5725336527 100644 --- a/trunk/fs/inotify.c +++ b/trunk/fs/inotify.c @@ -848,7 +848,11 @@ static int inotify_release(struct inode *ignored, struct file *file) inode = watch->inode; mutex_lock(&inode->inotify_mutex); mutex_lock(&dev->mutex); - remove_watch_no_event(watch, dev); + + /* make sure we didn't race with another list removal */ + if (likely(idr_find(&dev->idr, watch->wd))) + remove_watch_no_event(watch, dev); + mutex_unlock(&dev->mutex); mutex_unlock(&inode->inotify_mutex); put_inotify_watch(watch);