[patch] inotify: grab right lock

From: Robert Love
Date: Thu Nov 18 2004 - 19:48:52 EST


John,

Ah, another part of my locking rewrite I remember and should pull out
and send now.

We need to grab inode_lock before calling __iget().

Robert Love


need to hold inode_lock around __iget()

drivers/char/inotify.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletion(-)

diff -u linux/drivers/char/inotify.c linux/drivers/char/inotify.c
--- linux/drivers/char/inotify.c 2004-11-18 12:31:14.294242616 -0500
+++ linux/drivers/char/inotify.c 2004-11-18 13:59:33.400655992 -0500
@@ -171,7 +171,9 @@
goto release_and_out;
}

+ spin_lock(&inode_lock);
__iget(inode);
+ spin_unlock(&inode_lock);
release_and_out:
path_release(&nd);
out:
@@ -790,7 +792,7 @@
*/
static void inotify_release_all_watches(struct inotify_device *dev)
{
- struct inotify_watch *watch,*next;
+ struct inotify_watch *watch, *next;

list_for_each_entry_safe(watch, next, &dev->watches, d_list)
ignore_helper(watch, 0);


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/