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

Commit 72c23f08 authored by Trond Myklebust's avatar Trond Myklebust
Browse files

Merge branch 'bugfixes' into linux-next

* bugfixes:
  NFSv4.1: Fix an NFSv4.1 state renewal regression
  NFSv4: fix open/lock state recovery error handling
  NFSv4: Fix lock recovery when CREATE_SESSION/SETCLIENTID_CONFIRM fails
  NFS: Fabricate fscache server index key correctly
  SUNRPC: Add missing support for RPC_CLNT_CREATE_NO_RETRANS_TIMEOUT
  nfs: fix duplicate proc entries
parents 3fc3edf1 d1f456b0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1320,7 +1320,7 @@ static int nfs_server_list_show(struct seq_file *m, void *v)
 */
static int nfs_volume_list_open(struct inode *inode, struct file *file)
{
	return seq_open_net(inode, file, &nfs_server_list_ops,
	return seq_open_net(inode, file, &nfs_volume_list_ops,
			   sizeof(struct seq_net_private));
}

+1 −2
Original line number Diff line number Diff line
@@ -74,11 +74,10 @@ static uint16_t nfs_server_get_key(const void *cookie_netfs_data,
	struct nfs_server_key *key = buffer;
	uint16_t len = sizeof(struct nfs_server_key);

	memset(key, 0, len);
	key->nfsversion = clp->rpc_ops->version;
	key->family = clp->cl_addr.ss_family;

	memset(key, 0, len);

	switch (clp->cl_addr.ss_family) {
	case AF_INET:
		key->port = sin->sin_port;
+20 −18
Original line number Diff line number Diff line
@@ -482,6 +482,16 @@ int nfs40_walk_client_list(struct nfs_client *new,

	spin_lock(&nn->nfs_client_lock);
	list_for_each_entry(pos, &nn->nfs_client_list, cl_share_link) {

		if (pos->rpc_ops != new->rpc_ops)
			continue;

		if (pos->cl_proto != new->cl_proto)
			continue;

		if (pos->cl_minorversion != new->cl_minorversion)
			continue;

		/* If "pos" isn't marked ready, we can't trust the
		 * remaining fields in "pos" */
		if (pos->cl_cons_state > NFS_CS_READY) {
@@ -501,15 +511,6 @@ int nfs40_walk_client_list(struct nfs_client *new,
		if (pos->cl_cons_state != NFS_CS_READY)
			continue;

		if (pos->rpc_ops != new->rpc_ops)
			continue;

		if (pos->cl_proto != new->cl_proto)
			continue;

		if (pos->cl_minorversion != new->cl_minorversion)
			continue;

		if (pos->cl_clientid != new->cl_clientid)
			continue;

@@ -622,6 +623,16 @@ int nfs41_walk_client_list(struct nfs_client *new,

	spin_lock(&nn->nfs_client_lock);
	list_for_each_entry(pos, &nn->nfs_client_list, cl_share_link) {

		if (pos->rpc_ops != new->rpc_ops)
			continue;

		if (pos->cl_proto != new->cl_proto)
			continue;

		if (pos->cl_minorversion != new->cl_minorversion)
			continue;

		/* If "pos" isn't marked ready, we can't trust the
		 * remaining fields in "pos", especially the client
		 * ID and serverowner fields.  Wait for CREATE_SESSION
@@ -647,15 +658,6 @@ int nfs41_walk_client_list(struct nfs_client *new,
		if (pos->cl_cons_state != NFS_CS_READY)
			continue;

		if (pos->rpc_ops != new->rpc_ops)
			continue;

		if (pos->cl_proto != new->cl_proto)
			continue;

		if (pos->cl_minorversion != new->cl_minorversion)
			continue;

		if (!nfs4_match_clientids(pos, new))
			continue;

+23 −19
Original line number Diff line number Diff line
@@ -2234,9 +2234,13 @@ static int _nfs4_open_and_get_state(struct nfs4_opendata *opendata,
	ret = _nfs4_proc_open(opendata);
	if (ret != 0) {
		if (ret == -ENOENT) {
			d_drop(opendata->dentry);
			d_add(opendata->dentry, NULL);
			nfs_set_verifier(opendata->dentry,
			dentry = opendata->dentry;
			if (dentry->d_inode)
				d_delete(dentry);
			else if (d_unhashed(dentry))
				d_add(dentry, NULL);

			nfs_set_verifier(dentry,
					 nfs_save_change_attribute(opendata->dir->d_inode));
		}
		goto out;
@@ -2622,23 +2626,23 @@ static void nfs4_close_prepare(struct rpc_task *task, void *data)
	is_rdwr = test_bit(NFS_O_RDWR_STATE, &state->flags);
	is_rdonly = test_bit(NFS_O_RDONLY_STATE, &state->flags);
	is_wronly = test_bit(NFS_O_WRONLY_STATE, &state->flags);
	/* Calculate the current open share mode */
	/* Calculate the change in open mode */
	calldata->arg.fmode = 0;
	if (is_rdonly || is_rdwr)
	if (state->n_rdwr == 0) {
		if (state->n_rdonly == 0)
			call_close |= is_rdonly;
		else if (is_rdonly)
			calldata->arg.fmode |= FMODE_READ;
	if (is_wronly || is_rdwr)
		if (state->n_wronly == 0)
			call_close |= is_wronly;
		else if (is_wronly)
			calldata->arg.fmode |= FMODE_WRITE;
	/* Calculate the change in open mode */
	if (state->n_rdwr == 0) {
		if (state->n_rdonly == 0) {
			call_close |= is_rdonly || is_rdwr;
			calldata->arg.fmode &= ~FMODE_READ;
		}
		if (state->n_wronly == 0) {
			call_close |= is_wronly || is_rdwr;
			calldata->arg.fmode &= ~FMODE_WRITE;
		}
	}
	} else if (is_rdwr)
		calldata->arg.fmode |= FMODE_READ|FMODE_WRITE;

	if (calldata->arg.fmode == 0)
		call_close |= is_rdwr;

	if (!nfs4_valid_open_stateid(state))
		call_close = 0;
	spin_unlock(&state->owner->so_lock);
@@ -7368,7 +7372,7 @@ static int nfs41_proc_async_sequence(struct nfs_client *clp, struct rpc_cred *cr
	int ret = 0;

	if ((renew_flags & NFS4_RENEW_TIMEOUT) == 0)
		return 0;
		return -EAGAIN;
	task = _nfs41_proc_sequence(clp, cred, false);
	if (IS_ERR(task))
		ret = PTR_ERR(task);
+10 −2
Original line number Diff line number Diff line
@@ -88,10 +88,18 @@ nfs4_renew_state(struct work_struct *work)
			}
			nfs_expire_all_delegations(clp);
		} else {
			int ret;

			/* Queue an asynchronous RENEW. */
			ops->sched_state_renewal(clp, cred, renew_flags);
			ret = ops->sched_state_renewal(clp, cred, renew_flags);
			put_rpccred(cred);
			switch (ret) {
			default:
				goto out_exp;
			case -EAGAIN:
			case -ENOMEM:
				break;
			}
		}
	} else {
		dprintk("%s: failed to call renewd. Reason: lease not expired \n",
Loading