Re: [patch] inotify: use permission not vfs_permission

From: Robert Love
Date: Wed Nov 17 2004 - 15:39:59 EST


On Wed, 2004-11-17 at 15:25 -0500, Mike Waychison wrote:

> permission() still takes 3 arguments though. I think it is safe to pass
> NULL for the nameidata.

Ugh, I compile-tested the wrong tree. Thanks.

It is safe to pass NULL.

Patch below.

Robert Love


Use permission() instead of generic_permission().

Signed-Off-By: Robert Love <rml@xxxxxxxxxx>

diff -u linux/drivers/char/inotify.c linux/drivers/char/inotify.c
--- linux/drivers/char/inotify.c 2004-11-17 12:28:27.921136656 -0500
+++ linux/drivers/char/inotify.c 2004-11-17 12:28:27.921136656 -0500
@@ -166,7 +166,7 @@
inode = nd.dentry->d_inode;

/* you can only watch an inode if you have read permissions on it */
- error = vfs_permission(inode, MAY_READ);
+ error = permission(inode, MAY_READ, NULL);
if (error) {
inode = ERR_PTR(error);
goto release_and_out;


-
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/