]> git.baikalelectronics.ru Git - kernel.git/commit
inotify: fix locking around inotify watching in the idr
authorEric Paris <eparis@redhat.com>
Mon, 24 Aug 2009 20:03:35 +0000 (16:03 -0400)
committerEric Paris <eparis@redhat.com>
Thu, 27 Aug 2009 12:02:04 +0000 (08:02 -0400)
commitc3af34dee7d7460ce237d09633e1dec650882f29
tree5263cf56e792cfc5ddf37748d2868fce9866af68
parent1e5b9d59aa702ca7b00ea4668a9c7241fcf2633a
inotify: fix locking around inotify watching in the idr

The are races around the idr storage of inotify watches.  It's possible
that a watch could be found from sys_inotify_rm_watch() in the idr, but it
could be removed from the idr before that code does it's removal.  Move the
locking and the refcnt'ing so that these have to happen atomically.

Signed-off-by: Eric Paris <eparis@redhat.com>
fs/notify/inotify/inotify_user.c