diff options
author | 2006-05-22 14:26:25 -0400 | |
---|---|---|
committer | 2006-05-22 14:26:25 -0400 | |
commit | 3b38f317e529d8396377dafc7d95a1451a151df5 (patch) | |
tree | 65e80799417c456bdd907b7d80182732be02e5f4 /fs/inotify.c | |
parent | [PATCH] unused exports in wireless drivers (diff) | |
parent | [SPARC]: Add robust futex syscall entries. (diff) | |
download | linux-dev-3b38f317e529d8396377dafc7d95a1451a151df5.tar.xz linux-dev-3b38f317e529d8396377dafc7d95a1451a151df5.zip |
Merge branch 'from-linus' into upstream
Diffstat (limited to 'fs/inotify.c')
-rw-r--r-- | fs/inotify.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/inotify.c b/fs/inotify.c index 1f50302849c5..732ec4bd5774 100644 --- a/fs/inotify.c +++ b/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); @@ -890,8 +894,7 @@ static int inotify_ignore(struct inotify_device *dev, s32 wd) mutex_lock(&dev->mutex); /* make sure that we did not race */ - watch = idr_find(&dev->idr, wd); - if (likely(watch)) + if (likely(idr_find(&dev->idr, wd) == watch)) remove_watch(watch, dev); mutex_unlock(&dev->mutex); |