From: Trond Myklebust <Trond.Myklebust@netapp.com>
To: Bryan Schumaker <bjschuma@netapp.com>
Cc: "linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH v5 4/5] NFS: use secinfo when crossing mountpoints
Date: Thu, 17 Mar 2011 14:25:17 -0400 [thread overview]
Message-ID: <1300386317.28305.41.camel@lade.trondhjem.org> (raw)
In-Reply-To: <4D812377.8030908@netapp.com>
On Wed, 2011-03-16 at 16:54 -0400, Bryan Schumaker wrote:
> A submount may use different security than the parent
> mount does. We should figure out what sec flavor the
> submount uses at mount time.
>
> Signed-off-by: Bryan Schumaker <bjschuma@netapp.com>
> ---
> fs/nfs/inode.c | 8 ++-
> fs/nfs/internal.h | 7 ++
> fs/nfs/namespace.c | 102 ++++++++++++++++++++++++++++++++-
> fs/nfs/nfs4proc.c | 14 +++++
> fs/nfs/nfs4xdr.c | 11 ++--
> include/linux/nfs_xdr.h | 1 +
> net/sunrpc/auth_gss/gss_mech_switch.c | 22 +++++++
> 7 files changed, 154 insertions(+), 11 deletions(-)
>
> diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
> index 01768e5..058d7d6 100644
> --- a/fs/nfs/inode.c
> +++ b/fs/nfs/inode.c
> @@ -254,7 +254,9 @@ nfs_fhget(struct super_block *sb, struct nfs_fh *fh, struct nfs_fattr *fattr)
> struct inode *inode = ERR_PTR(-ENOENT);
> unsigned long hash;
>
> - if ((fattr->valid & NFS_ATTR_FATTR_FILEID) == 0)
> + nfs_attr_check_mountpoint(sb, fattr);
> +
> + if ((fattr->valid & NFS_ATTR_FATTR_FILEID) == 0 && (fattr->valid & NFS_ATTR_FATTR_MOUNTPOINT) == 0)
This is equivalent to
if (fattr->valid & (NFS_ATTR_FATTR_FILEID|NFS_ATTR_FATTR_MOUNTPOINT) == 0)
> goto out_no_inode;
> if ((fattr->valid & NFS_ATTR_FATTR_TYPE) == 0)
> goto out_no_inode;
> @@ -298,8 +300,8 @@ nfs_fhget(struct super_block *sb, struct nfs_fh *fh, struct nfs_fattr *fattr)
> if (nfs_server_capable(inode, NFS_CAP_READDIRPLUS))
> set_bit(NFS_INO_ADVISE_RDPLUS, &NFS_I(inode)->flags);
> /* Deal with crossing mountpoints */
> - if ((fattr->valid & NFS_ATTR_FATTR_FSID)
> - && !nfs_fsid_equal(&NFS_SB(sb)->fsid, &fattr->fsid)) {
> + if (fattr->valid & NFS_ATTR_FATTR_MOUNTPOINT ||
> + fattr->valid & NFS_ATTR_FATTR_V4_REFERRAL) {
This is equivalent to
if (fattr->valid & (NFS_ATTR_FATTR_MOUNTPOINT|NFS_ATTR_FATTR_V4_REFERRAL))
> if (fattr->valid & NFS_ATTR_FATTR_V4_REFERRAL)
> inode->i_op = &nfs_referral_inode_operations;
> else
<snip>
> @@ -116,6 +202,7 @@ struct vfsmount *nfs_d_automount(struct path *path)
> struct nfs_fh *fh = NULL;
> struct nfs_fattr *fattr = NULL;
> int err;
> + rpc_authflavor_t flavor = 1;
Please use the flavour name (i.e. RPC_AUTH_UNIX) in situations like
this. It is hard to remember that 1 == auth unix.
> dprintk("--> nfs_d_automount()\n");
>
--
Trond Myklebust
Linux NFS client maintainer
NetApp
Trond.Myklebust@netapp.com
www.netapp.com
prev parent reply other threads:[~2011-03-17 18:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-16 20:54 [PATCH v5 4/5] NFS: use secinfo when crossing mountpoints Bryan Schumaker
2011-03-17 18:25 ` Trond Myklebust [this message]
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=1300386317.28305.41.camel@lade.trondhjem.org \
--to=trond.myklebust@netapp.com \
--cc=bjschuma@netapp.com \
--cc=linux-nfs@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).