Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5df6b8e6 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'nfs-for-2.6.36' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6

* 'nfs-for-2.6.36' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6: (42 commits)
  NFS: NFSv4.1 is no longer a "developer only" feature
  NFS: NFS_V4 is no longer an EXPERIMENTAL feature
  NFS: Fix /proc/mount for legacy binary interface
  NFS: Fix the locking in nfs4_callback_getattr
  SUNRPC: Defer deleting the security context until gss_do_free_ctx()
  SUNRPC: prevent task_cleanup running on freed xprt
  SUNRPC: Reduce asynchronous RPC task stack usage
  SUNRPC: Move the bound cred to struct rpc_rqst
  SUNRPC: Clean up of rpc_bindcred()
  SUNRPC: Move remaining RPC client related task initialisation into clnt.c
  SUNRPC: Ensure that rpc_exit() always wakes up a sleeping task
  SUNRPC: Make the credential cache hashtable size configurable
  SUNRPC: Store the hashtable size in struct rpc_cred_cache
  NFS: Ensure the AUTH_UNIX credcache is allocated dynamically
  NFS: Fix the NFS users of rpc_restart_call()
  SUNRPC: The function rpc_restart_call() should return success/failure
  NFSv4: Get rid of the bogus RPC_ASSASSINATED(task) checks
  NFSv4: Clean up the process of renewing the NFSv4 lease
  NFSv4.1: Handle NFS4ERR_DELAY on SEQUENCE correctly
  NFS: nfs_rename() should not have to flush out writebacks
  ...
parents fe21ea18 3dce9a5c
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -61,8 +61,8 @@ config NFS_V3_ACL
	  If unsure, say N.

config NFS_V4
	bool "NFS client support for NFS version 4 (EXPERIMENTAL)"
	depends on NFS_FS && EXPERIMENTAL
	bool "NFS client support for NFS version 4"
	depends on NFS_FS
	select RPCSEC_GSS_KRB5
	help
	  This option enables support for version 4 of the NFS protocol
@@ -72,16 +72,16 @@ config NFS_V4
	  space programs which can be found in the Linux nfs-utils package,
	  available from http://linux-nfs.org/.

	  If unsure, say N.
	  If unsure, say Y.

config NFS_V4_1
	bool "NFS client support for NFSv4.1 (DEVELOPER ONLY)"
	bool "NFS client support for NFSv4.1 (EXPERIMENTAL)"
	depends on NFS_V4 && EXPERIMENTAL
	help
	  This option enables support for minor version 1 of the NFSv4 protocol
	  (draft-ietf-nfsv4-minorversion1) in the kernel's NFS client.

	  Unless you're an NFS developer, say N.
	  If unsure, say N.

config ROOT_NFS
	bool "Root file system on NFS"
+4 −15
Original line number Diff line number Diff line
@@ -37,8 +37,8 @@ __be32 nfs4_callback_getattr(struct cb_getattrargs *args, struct cb_getattrres *
	if (inode == NULL)
		goto out_putclient;
	nfsi = NFS_I(inode);
	down_read(&nfsi->rwsem);
	delegation = nfsi->delegation;
	rcu_read_lock();
	delegation = rcu_dereference(nfsi->delegation);
	if (delegation == NULL || (delegation->type & FMODE_WRITE) == 0)
		goto out_iput;
	res->size = i_size_read(inode);
@@ -53,7 +53,7 @@ __be32 nfs4_callback_getattr(struct cb_getattrargs *args, struct cb_getattrres *
		args->bitmap[1];
	res->status = 0;
out_iput:
	up_read(&nfsi->rwsem);
	rcu_read_unlock();
	iput(inode);
out_putclient:
	nfs_put_client(clp);
@@ -62,16 +62,6 @@ out:
	return res->status;
}

static int (*nfs_validate_delegation_stateid(struct nfs_client *clp))(struct nfs_delegation *, const nfs4_stateid *)
{
#if defined(CONFIG_NFS_V4_1)
	if (clp->cl_minorversion > 0)
		return nfs41_validate_delegation_stateid;
#endif
	return nfs4_validate_delegation_stateid;
}


__be32 nfs4_callback_recall(struct cb_recallargs *args, void *dummy)
{
	struct nfs_client *clp;
@@ -92,8 +82,7 @@ __be32 nfs4_callback_recall(struct cb_recallargs *args, void *dummy)
		inode = nfs_delegation_find_inode(clp, &args->fh);
		if (inode != NULL) {
			/* Set up a helper thread to actually return the delegation */
			switch (nfs_async_inode_return_delegation(inode, &args->stateid,
								  nfs_validate_delegation_stateid(clp))) {
			switch (nfs_async_inode_return_delegation(inode, &args->stateid)) {
				case 0:
					res = 0;
					break;
+13 −8
Original line number Diff line number Diff line
@@ -150,6 +150,7 @@ static struct nfs_client *nfs_alloc_client(const struct nfs_client_initdata *cl_
	clp->cl_boot_time = CURRENT_TIME;
	clp->cl_state = 1 << NFS4CLNT_LEASE_EXPIRED;
	clp->cl_minorversion = cl_init->minorversion;
	clp->cl_mvops = nfs_v4_minor_ops[cl_init->minorversion];
#endif
	cred = rpc_lookup_machine_cred();
	if (!IS_ERR(cred))
@@ -178,7 +179,7 @@ static void nfs4_clear_client_minor_version(struct nfs_client *clp)
		clp->cl_session = NULL;
	}

	clp->cl_call_sync = _nfs4_call_sync;
	clp->cl_mvops = nfs_v4_minor_ops[0];
#endif /* CONFIG_NFS_V4_1 */
}

@@ -188,7 +189,7 @@ static void nfs4_clear_client_minor_version(struct nfs_client *clp)
static void nfs4_destroy_callback(struct nfs_client *clp)
{
	if (__test_and_clear_bit(NFS_CS_CALLBACK, &clp->cl_res_state))
		nfs_callback_down(clp->cl_minorversion);
		nfs_callback_down(clp->cl_mvops->minor_version);
}

static void nfs4_shutdown_client(struct nfs_client *clp)
@@ -1126,7 +1127,7 @@ static int nfs4_init_callback(struct nfs_client *clp)
				return error;
		}

		error = nfs_callback_up(clp->cl_minorversion,
		error = nfs_callback_up(clp->cl_mvops->minor_version,
					clp->cl_rpcclient->cl_xprt);
		if (error < 0) {
			dprintk("%s: failed to start callback. Error = %d\n",
@@ -1143,10 +1144,8 @@ static int nfs4_init_callback(struct nfs_client *clp)
 */
static int nfs4_init_client_minor_version(struct nfs_client *clp)
{
	clp->cl_call_sync = _nfs4_call_sync;

#if defined(CONFIG_NFS_V4_1)
	if (clp->cl_minorversion) {
	if (clp->cl_mvops->minor_version) {
		struct nfs4_session *session = NULL;
		/*
		 * Create the session and mark it expired.
@@ -1158,7 +1157,13 @@ static int nfs4_init_client_minor_version(struct nfs_client *clp)
			return -ENOMEM;

		clp->cl_session = session;
		clp->cl_call_sync = _nfs4_call_sync_session;
		/*
		 * The create session reply races with the server back
		 * channel probe. Mark the client NFS_CS_SESSION_INITING
		 * so that the client back channel can find the
		 * nfs_client struct
		 */
		clp->cl_cons_state = NFS_CS_SESSION_INITING;
	}
#endif /* CONFIG_NFS_V4_1 */

@@ -1454,7 +1459,7 @@ struct nfs_server *nfs4_create_referral_server(struct nfs_clone_mount *data,
				data->authflavor,
				parent_server->client->cl_xprt->prot,
				parent_server->client->cl_timeout,
				parent_client->cl_minorversion);
				parent_client->cl_mvops->minor_version);
	if (error < 0)
		goto error;

+3 −13
Original line number Diff line number Diff line
@@ -268,14 +268,6 @@ out:
	return status;
}

/* Sync all data to disk upon delegation return */
static void nfs_msync_inode(struct inode *inode)
{
	filemap_fdatawrite(inode->i_mapping);
	nfs_wb_all(inode);
	filemap_fdatawait(inode->i_mapping);
}

/*
 * Basic procedure for returning a delegation to the server
 */
@@ -367,7 +359,7 @@ int nfs_inode_return_delegation(struct inode *inode)
		delegation = nfs_detach_delegation_locked(nfsi, NULL, clp);
		spin_unlock(&clp->cl_lock);
		if (delegation != NULL) {
			nfs_msync_inode(inode);
			nfs_wb_all(inode);
			err = __nfs_inode_return_delegation(inode, delegation, 1);
		}
	}
@@ -471,9 +463,7 @@ void nfs_expire_unreferenced_delegations(struct nfs_client *clp)
/*
 * Asynchronous delegation recall!
 */
int nfs_async_inode_return_delegation(struct inode *inode, const nfs4_stateid *stateid,
				      int (*validate_stateid)(struct nfs_delegation *delegation,
							      const nfs4_stateid *stateid))
int nfs_async_inode_return_delegation(struct inode *inode, const nfs4_stateid *stateid)
{
	struct nfs_client *clp = NFS_SERVER(inode)->nfs_client;
	struct nfs_delegation *delegation;
@@ -481,7 +471,7 @@ int nfs_async_inode_return_delegation(struct inode *inode, const nfs4_stateid *s
	rcu_read_lock();
	delegation = rcu_dereference(NFS_I(inode)->delegation);

	if (!validate_stateid(delegation, stateid)) {
	if (!clp->cl_mvops->validate_stateid(delegation, stateid)) {
		rcu_read_unlock();
		return -ENOENT;
	}
+1 −3
Original line number Diff line number Diff line
@@ -34,9 +34,7 @@ enum {
int nfs_inode_set_delegation(struct inode *inode, struct rpc_cred *cred, struct nfs_openres *res);
void nfs_inode_reclaim_delegation(struct inode *inode, struct rpc_cred *cred, struct nfs_openres *res);
int nfs_inode_return_delegation(struct inode *inode);
int nfs_async_inode_return_delegation(struct inode *inode, const nfs4_stateid *stateid,
				      int (*validate_stateid)(struct nfs_delegation *delegation,
							      const nfs4_stateid *stateid));
int nfs_async_inode_return_delegation(struct inode *inode, const nfs4_stateid *stateid);
void nfs_inode_return_delegation_noreclaim(struct inode *inode);

struct inode *nfs_delegation_find_inode(struct nfs_client *clp, const struct nfs_fh *fhandle);
Loading