Commit baea40de authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'rxrpc-misc'



David Howells says:

====================
rxrpc: Miscellaneous changes

Here are some miscellaneous changes for AF_RXRPC:

 (1) Allow the list of local endpoints to be viewed through /proc.

 (2) Switch to using refcount_t for refcounting.

 (3) Fix a locking issue found by lockdep.

 (4) Autogenerate tracing symbol enums from symbol->string maps to make it
     easier to keep them in sync.

 (5) Return an error to sendmsg() if a call it tried to set up failed.
     Because it failed at this point, no notification will be generated for
     recvmsg to pick up - but userspace still needs to know about the
     failure.

 (6) Fix the selection of abort codes generated by internal events.  In
     particular, rxrpc and kafs shouldn't be generating RX_USER_ABORT
     unless it's because userspace did something to cancel a call.

 (7) Adjust the interpretation and handling of certain ACK types to try and
     detect NAT changes causing a call to seem to start mid-flow from a
     different peer.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 0598cec9 adc9613f
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -163,8 +163,11 @@ void afs_prioritise_error(struct afs_error *e, int error, u32 abort_code)
		return;

	case -ECONNABORTED:
		error = afs_abort_to_error(abort_code);
		fallthrough;
	case -ENETRESET: /* Responded, but we seem to have changed address */
		e->responded = true;
		e->error = afs_abort_to_error(abort_code);
		e->error = error;
		return;
	}
}
+4 −0
Original line number Diff line number Diff line
@@ -292,6 +292,10 @@ bool afs_select_fileserver(struct afs_operation *op)
		op->error = error;
		goto iterate_address;

	case -ENETRESET:
		pr_warn("kAFS: Peer reset %s (op=%x)\n",
			op->type ? op->type->name : "???", op->debug_id);
		fallthrough;
	case -ECONNRESET:
		_debug("call reset");
		op->error = error;
+5 −3
Original line number Diff line number Diff line
@@ -537,6 +537,8 @@ static void afs_deliver_to_call(struct afs_call *call)
		case -ENODATA:
		case -EBADMSG:
		case -EMSGSIZE:
		case -ENOMEM:
		case -EFAULT:
			abort_code = RXGEN_CC_UNMARSHAL;
			if (state != AFS_CALL_CL_AWAIT_REPLY)
				abort_code = RXGEN_SS_UNMARSHAL;
@@ -544,7 +546,7 @@ static void afs_deliver_to_call(struct afs_call *call)
						abort_code, ret, "KUM");
			goto local_abort;
		default:
			abort_code = RX_USER_ABORT;
			abort_code = RX_CALL_DEAD;
			rxrpc_kernel_abort_call(call->net->socket, call->rxcall,
						abort_code, ret, "KER");
			goto local_abort;
@@ -836,7 +838,7 @@ void afs_send_empty_reply(struct afs_call *call)
	case -ENOMEM:
		_debug("oom");
		rxrpc_kernel_abort_call(net->socket, call->rxcall,
					RX_USER_ABORT, -ENOMEM, "KOO");
					RXGEN_SS_MARSHAL, -ENOMEM, "KOO");
		fallthrough;
	default:
		_leave(" [error]");
@@ -878,7 +880,7 @@ void afs_send_simple_reply(struct afs_call *call, const void *buf, size_t len)
	if (n == -ENOMEM) {
		_debug("oom");
		rxrpc_kernel_abort_call(net->socket, call->rxcall,
					RX_USER_ABORT, -ENOMEM, "KOO");
					RXGEN_SS_MARSHAL, -ENOMEM, "KOO");
	}
	_leave(" [error]");
}
+1 −0
Original line number Diff line number Diff line
@@ -636,6 +636,7 @@ static ssize_t afs_write_back_from_locked_folio(struct address_space *mapping,
	case -EKEYEXPIRED:
	case -EKEYREJECTED:
	case -EKEYREVOKED:
	case -ENETRESET:
		afs_redirty_pages(wbc, mapping, start, len);
		mapping_set_error(mapping, ret);
		break;
+32 −0
Original line number Diff line number Diff line
@@ -931,6 +931,38 @@ struct list_head *seq_list_next(void *v, struct list_head *head, loff_t *ppos)
}
EXPORT_SYMBOL(seq_list_next);

struct list_head *seq_list_start_rcu(struct list_head *head, loff_t pos)
{
	struct list_head *lh;

	list_for_each_rcu(lh, head)
		if (pos-- == 0)
			return lh;

	return NULL;
}
EXPORT_SYMBOL(seq_list_start_rcu);

struct list_head *seq_list_start_head_rcu(struct list_head *head, loff_t pos)
{
	if (!pos)
		return head;

	return seq_list_start_rcu(head, pos - 1);
}
EXPORT_SYMBOL(seq_list_start_head_rcu);

struct list_head *seq_list_next_rcu(void *v, struct list_head *head,
				    loff_t *ppos)
{
	struct list_head *lh;

	lh = list_next_rcu((struct list_head *)v);
	++*ppos;
	return lh == head ? NULL : lh;
}
EXPORT_SYMBOL(seq_list_next_rcu);

/**
 * seq_hlist_start - start an iteration of a hlist
 * @head: the head of the hlist
Loading