Linux NFS development
 help / color / mirror / Atom feed
From: Bryan Schumaker <bjschuma@netapp.com>
To: "Myklebust, Trond" <Trond.Myklebust@netapp.com>
Cc: "Schumaker, Bryan" <Bryan.Schumaker@netapp.com>,
	"linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
	"steved@redhat.com" <steved@redhat.com>
Subject: Re: [PATCH v4 6/9] NFS: Remove unused function nfs_lookup_with_sec()
Date: Fri, 27 Apr 2012 12:12:06 -0400	[thread overview]
Message-ID: <4F9AC556.9020201@netapp.com> (raw)
In-Reply-To: <1335542792.3910.12.camel@lade.trondhjem.org>

On 04/27/12 12:06, Myklebust, Trond wrote:

> On Thu, 2012-04-26 at 16:56 -0400, bjschuma@netapp.com wrote:
>> From: Bryan Schumaker <bjschuma@netapp.com>
>>
>> This fixes a compiler warning.
>>
>> Signed-off-by: Bryan Schumaker <bjschuma@netapp.com>
>> ---
>>  fs/nfs/namespace.c |   84 ++++++++++------------------------------------------
>>  1 file changed, 15 insertions(+), 69 deletions(-)
>>
>> diff --git a/fs/nfs/namespace.c b/fs/nfs/namespace.c
>> index 779f06a..d51868e 100644
>> --- a/fs/nfs/namespace.c
>> +++ b/fs/nfs/namespace.c
>> @@ -148,84 +148,31 @@ rpc_authflavor_t nfs_find_best_sec(struct nfs4_secinfo_flavors *flavors)
>>  	return pseudoflavor;
>>  }
>>  
>> -static int nfs_negotiate_security(const struct dentry *parent,
>> -				  const struct dentry *dentry,
>> -				  rpc_authflavor_t *flavor)
>> -{
>> -	struct page *page;
>> -	struct nfs4_secinfo_flavors *flavors;
>> -	int (*secinfo)(struct inode *, const struct qstr *, struct nfs4_secinfo_flavors *);
>> -	int ret = -EPERM;
>> -
>> -	secinfo = NFS_PROTO(parent->d_inode)->secinfo;
>> -	if (secinfo != NULL) {
>> -		page = alloc_page(GFP_KERNEL);
>> -		if (!page) {
>> -			ret = -ENOMEM;
>> -			goto out;
>> -		}
>> -		flavors = page_address(page);
>> -		ret = secinfo(parent->d_inode, &dentry->d_name, flavors);
>> -		*flavor = nfs_find_best_sec(flavors);
>> -		put_page(page);
>> -	}
>> -
>> -out:
>> -	return ret;
>> -}
>> -
>> -static int nfs_lookup_with_sec(struct nfs_server *server, struct dentry *parent,
>> -			       struct dentry *dentry, struct path *path,
>> -			       struct nfs_fh *fh, struct nfs_fattr *fattr,
>> -			       rpc_authflavor_t *flavor)
>> -{
>> -	struct rpc_clnt *clone;
>> -	struct rpc_auth *auth;
>> -	int err;
>> -
>> -	err = nfs_negotiate_security(parent, path->dentry, flavor);
>> -	if (err < 0)
>> -		goto out;
>> -	clone  = rpc_clone_client(server->client);
>> -	auth   = rpcauth_create(*flavor, clone);
>> -	if (!auth) {
>> -		err = -EIO;
>> -		goto out_shutdown;
>> -	}
>> -	err = server->nfs_client->rpc_ops->lookup(clone, parent->d_inode,
>> -						  &path->dentry->d_name,
>> -						  fh, fattr);
>> -out_shutdown:
>> -	rpc_shutdown_client(clone);
>> -out:
>> -	return err;
>> -}
>> -
>>  static struct rpc_clnt *nfs_lookup_mountpoint(struct inode *dir,
>>  					      struct qstr *name,
>>  					      struct nfs_fh *fh,
>>  					      struct nfs_fattr *fattr)
>>  {
>> -	if (NFS_PROTO(dir)->version != 4)
>> -		return rpc_clone_client(NFS_SERVER(dir)->client);
>> -	return nfs4_proc_lookup_mountpoint(dir, name, fh, fattr);
>> +	int err;
>> +
>> +	if (NFS_PROTO(dir)->version == 4)
>> +		return nfs4_proc_lookup_mountpoint(dir, name, fh, fattr);
>> +
>> +	err = NFS_PROTO(dir)->lookup(NFS_SERVER(dir)->client, dir, name, fh, fattr);
>> +	if (err)
>> +		return ERR_PTR(err);
>> +	return rpc_clone_client(NFS_SERVER(dir)->client);
> 
> Where does this come from, and how is it relevant to removing
> nfs_lookup_with_sec?


It made sense to me at the time... but it really should be worked into the previous patches.  I'll fix that now.

- Bryan

> 
>>  }
>>  #else /* CONFIG_NFS_V4 */
>> -static inline int nfs_lookup_with_sec(struct nfs_server *server,
>> -				      struct dentry *parent, struct dentry *dentry,
>> -				      struct path *path, struct nfs_fh *fh,
>> -				      struct nfs_fattr *fattr,
>> -				      rpc_authflavor_t *flavor)
>> -{
>> -	return -EPERM;
>> -}
>> -
>> -static inline struct rpc_clnt *nfs_lookup_mountpoint(struct inode *inode,
>> +static inline struct rpc_clnt *nfs_lookup_mountpoint(struct inode *dir,
>>  						     struct qstr *name,
>>  						     struct nfs_fh *fh,
>>  						     struct nfs_fattr *fattr)
>>  {
>> -	return rpc_clone_client(NFS_SERVER(inode)->client);
>> +	int err = NFS_PROTO(dir)->lookup(NFS_SERVER(dir)->client, dir, name, fh, fattr);
>> +	if (err)
>> +		return ERR_PTR(err);
> 
> Ditto. This definitely belongs in a separate patch.
> 
>> +	return rpc_clone_client(NFS_SERVER(dir)->client);
>>  }
>>  #endif /* CONFIG_NFS_V4 */
>>  
>> @@ -248,7 +195,6 @@ struct vfsmount *nfs_d_automount(struct path *path)
>>  	struct nfs_fh *fh = NULL;
>>  	struct nfs_fattr *fattr = NULL;
>>  	struct rpc_clnt *client;
>> -	rpc_authflavor_t flavor = RPC_AUTH_UNIX;
>>  
>>  	dprintk("--> nfs_d_automount()\n");
>>  
>> @@ -276,7 +222,7 @@ struct vfsmount *nfs_d_automount(struct path *path)
>>  	if (fattr->valid & NFS_ATTR_FATTR_V4_REFERRAL)
>>  		mnt = nfs_do_refmount(client, path->dentry);
>>  	else
>> -		mnt = nfs_do_submount(path->dentry, fh, fattr, flavor);
>> +		mnt = nfs_do_submount(path->dentry, fh, fattr, client->cl_auth->au_flavor);
>>  	rpc_shutdown_client(client);
>>  
>>  	if (IS_ERR(mnt))
> 



  reply	other threads:[~2012-04-27 16:12 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-26 20:56 [PATCH v4 0/9] Fix SECINFO procedure bjschuma
2012-04-26 20:56 ` [PATCH v4 1/9] NFS: Fix SECINFO_NO_NAME bjschuma
2012-04-26 20:56 ` [PATCH v4 2/9] NFS: Handle exceptions coming out of nfs4_proc_fs_locations() bjschuma
2012-04-26 20:56 ` [PATCH v4 3/9] NFS: Do secinfo as part of lookup bjschuma
2012-04-26 20:56 ` [PATCH v4 4/9] NFS: Fix following referral mount points with different security bjschuma
2012-04-26 20:56 ` [PATCH v4 5/9] NFS: Honor the authflavor set in the clone mount data bjschuma
2012-04-26 20:56 ` [PATCH v4 6/9] NFS: Remove unused function nfs_lookup_with_sec() bjschuma
2012-04-27 16:06   ` Myklebust, Trond
2012-04-27 16:12     ` Bryan Schumaker [this message]
2012-04-26 20:56 ` [PATCH v4 7/9] NFS: Remove secinfo knowledge out of the generic client bjschuma
2012-04-26 20:56 ` [PATCH v4 8/9] NFS: Create a submount rpc_op bjschuma
2012-04-26 20:56 ` [PATCH v4 9/9] NFS: Remove extra rpc_clnt argument to proc_lookup bjschuma

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=4F9AC556.9020201@netapp.com \
    --to=bjschuma@netapp.com \
    --cc=Bryan.Schumaker@netapp.com \
    --cc=Trond.Myklebust@netapp.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=steved@redhat.com \
    /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