Re: [PATCH] Bind Mount Extensions 0.04.1 3/5

From: viro
Date: Thu Mar 18 2004 - 07:28:53 EST


On Mon, Mar 15, 2004 at 08:58:14AM +0100, Herbert Poetzl wrote:
> -extern int vfs_permission(struct inode *, int);
> +extern int vfs_permission(struct inode *, int, struct nameidata *);

Vetoed, along with IS_RDONLY() prototype change.

Note that you are doing exactly the opposite of the changes we'll need
to deal with remount races.

What we need is to push readonly checks _up_ - into callers of fs methods.
vfs_permission() is default ->permission() - no more, no less. Neither
it nor other instances have any business touching "this vfsmount is readonly"
logics - it's not something where fs can override stuff; it's "admin said
no r/w access here".

IOW, the check for r/w access to file/directory/symlink on a r/o mount should
be moved into the callers (very few of them) of ->permission() and away from
the methods themselves.
-
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/