Commit:     c7eb26678e59f16f4e84f1176d187cd21a27414d
Parent:     b41572e929221b0d87f529106cdf12185ee84bca
Author:     Dave Hansen <[EMAIL PROTECTED]>
AuthorDate: Tue Oct 16 23:31:14 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Wed Oct 17 08:43:05 2007 -0700

    r/o bind mounts: give permission() a local 'mnt' variable
    First of all, this makes the structure jumping look a little bit cleaner.  
    this stands alone as a tiny cleanup.  But, we also need 'mnt' by itself a 
    more times later in this series, so this isn't _just_ a cleanup.
    Signed-off-by: Dave Hansen <[EMAIL PROTECTED]>
    Cc: Christoph Hellwig <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
 fs/namei.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/fs/namei.c b/fs/namei.c
index a29bb0f..464eecc 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -228,6 +228,10 @@ int generic_permission(struct inode *inode, int mask,
 int permission(struct inode *inode, int mask, struct nameidata *nd)
        int retval, submask;
+       struct vfsmount *mnt = NULL;
+       if (nd)
+               mnt = nd->mnt;
        if (mask & MAY_WRITE) {
                umode_t mode = inode->i_mode;
@@ -251,7 +255,7 @@ int permission(struct inode *inode, int mask, struct 
nameidata *nd)
                 * MAY_EXEC on regular files is denied if the fs is mounted
                 * with the "noexec" flag.
-               if (nd && nd->mnt && (nd->mnt->mnt_flags & MNT_NOEXEC))
+               if (mnt && (mnt->mnt_flags & MNT_NOEXEC))
                        return -EACCES;
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to