From: Herbert Poetzl <herbert@13thfloor.at>
To: Andrew Morton <akpm@osdl.org>,
Christoph Hellwig <hch@infradead.org>,
Al Viro <viro@ftp.linux.org.uk>,
Linux Kernel ML <linux-kernel@vger.kernel.org>
Subject: [RFC 2/2] vfs: fixup nfs and fuse by passing nd_flags via mask
Date: Tue, 28 Feb 2006 06:30:46 +0100 [thread overview]
Message-ID: <20060228053046.GC6494@MAIL.13thfloor.at> (raw)
In-Reply-To: <20060228052606.GA6494@MAIL.13thfloor.at>
fixup nfs and fuse nameidata related checks by
passing the relevant flags via the mask.
Signed-off-by: Herbert Pötzl <herbert@13thfloor.at>
Acked-by: Sam Vilain <sam.vilain@catalyst.net.nz>
---
diff -NurpP --minimal linux-2.6.16-rc5-vfs0.02.1/fs/fuse/dir.c linux-2.6.16-rc5-vfs0.02.2/fs/fuse/dir.c
--- linux-2.6.16-rc5-vfs0.02.1/fs/fuse/dir.c 2006-02-28 05:56:38 +0100
+++ linux-2.6.16-rc5-vfs0.02.2/fs/fuse/dir.c 2006-02-28 05:49:57 +0100
@@ -731,8 +731,9 @@ static int fuse_permission(struct inode
if ((mask & MAY_EXEC) && !S_ISDIR(mode) && !(mode & S_IXUGO))
return -EACCES;
- if (nd && (nd->flags & LOOKUP_ACCESS))
+ if (mask & LOOKUP_ACCESS)
return fuse_access(inode, mask);
+
return 0;
}
}
diff -NurpP --minimal linux-2.6.16-rc5-vfs0.02.1/fs/namei.c linux-2.6.16-rc5-vfs0.02.2/fs/namei.c
--- linux-2.6.16-rc5-vfs0.02.1/fs/namei.c 2006-02-28 05:34:28 +0100
+++ linux-2.6.16-rc5-vfs0.02.2/fs/namei.c 2006-02-28 05:47:29 +0100
@@ -271,8 +271,11 @@ int permission(struct inode *inode, int
*/
int vfs_permission(struct nameidata *nd, int mask)
{
+ int nd_flags = nd->flags &
+ (LOOKUP_ACCESS | LOOKUP_CREATE | LOOKUP_OPEN);
+
/* do nd based stuff here */
- return permission(nd->dentry->d_inode, mask);
+ return permission(nd->dentry->d_inode, mask | nd_flags);
}
/**
diff -NurpP --minimal linux-2.6.16-rc5-vfs0.02.1/fs/nfs/dir.c linux-2.6.16-rc5-vfs0.02.2/fs/nfs/dir.c
--- linux-2.6.16-rc5-vfs0.02.1/fs/nfs/dir.c 2006-02-28 05:56:38 +0100
+++ linux-2.6.16-rc5-vfs0.02.2/fs/nfs/dir.c 2006-02-28 05:51:36 +0100
@@ -1643,7 +1643,7 @@ int nfs_permission(struct inode *inode,
if (mask == 0)
goto out;
/* Is this sys_access() ? */
- if (nd != NULL && (nd->flags & LOOKUP_ACCESS))
+ if (mask & LOOKUP_ACCESS)
goto force_lookup;
switch (inode->i_mode & S_IFMT) {
@@ -1652,8 +1652,7 @@ int nfs_permission(struct inode *inode,
case S_IFREG:
/* NFSv4 has atomic_open... */
if (nfs_server_capable(inode, NFS_CAP_ATOMIC_OPEN)
- && nd != NULL
- && (nd->flags & LOOKUP_OPEN))
+ && (mask & LOOKUP_OPEN))
goto out;
break;
case S_IFDIR:
next prev parent reply other threads:[~2006-02-28 5:30 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-28 5:26 [RFC] vfs: cleanup of permission() Herbert Poetzl
2006-02-28 5:29 ` [RFC 1/2] vfs: remove nameidata from *_permission() Herbert Poetzl
2006-02-28 5:30 ` Herbert Poetzl [this message]
2006-03-01 8:45 ` [RFC] vfs: cleanup of permission() Trond Myklebust
2006-03-01 12:28 ` tvrtko.ursulin
2006-03-01 12:37 ` Arjan van de Ven
2006-03-01 12:59 ` tvrtko.ursulin
2006-03-01 21:20 ` Sam Vilain
2006-03-01 13:06 ` Herbert Poetzl
2006-03-01 21:18 ` Sam Vilain
2006-03-01 13:11 ` Herbert Poetzl
2006-03-01 23:42 ` Trond Myklebust
2006-03-02 1:35 ` Sam Vilain
2006-03-02 2:26 ` Trond Myklebust
2006-03-01 22:11 ` Sam Vilain
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060228053046.GC6494@MAIL.13thfloor.at \
--to=herbert@13thfloor.at \
--cc=akpm@osdl.org \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@ftp.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome