From 32543cbbc3be559391a5e7d116b7fc81de94a3f1 Mon Sep 17 00:00:00 2001 From: Amy Griffis Date: Sat, 20 May 2006 15:00:06 -0700 Subject: [PATCH] --- yaml --- r: 26854 b: refs/heads/master c: 66055a4e7334b05354c835123ff621c5f700e56a h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/inotify.c | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) 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);