Skip to contentSkip to conversation

net/smc: fix smc_poll in SMC_INIT state

PATCH In review Ursula Braun 2 participants 2 messages Feb 21, 2019

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/smc: fix smc_poll in SMC_INIT state

smc_poll() returns with mask bit EPOLLPRI if the connection urg_state is SMC_URG_VALID. Since SMC_URG_VALID is zero, smc_poll signals EPOLLPRI errorneously if called in state SMC_INIT before the connection is created, for instance in a non-blocking connect scenario.

This patch switches to non-zero values for the urg states.

Fixes de8474eb9d50 ("net/smc: urgent data support")
---
 net/smc/smc.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
net/smc/smc.h +3 -3
index 5721416d0605..adbdf195eb08 100644
@@ -113,9 +113,9 @@ struct smc_host_cdc_msg {		/* Connection Data Control message */
 } __aligned(8);
 
 enum smc_urg_state {
-	SMC_URG_VALID,			/* data present */
-	SMC_URG_NOTYET,			/* data pending */
-	SMC_URG_READ			/* data was already read */
+	SMC_URG_VALID	= 1,			/* data present */
+	SMC_URG_NOTYET	= 2,			/* data pending */
+	SMC_URG_READ	= 3,			/* data was already read */
 };
 
 struct smc_connection {
Signature · 1 line
2.16.4
maintainer
#1 lore raw

From: Ursula Braun <[email protected]>
Date: Thu, 21 Feb 2019 12:56:54 +0100

Quoted 10 lines

smc_poll() returns with mask bit EPOLLPRI if the connection urg_state is SMC_URG_VALID. Since SMC_URG_VALID is zero, smc_poll signals EPOLLPRI errorneously if called in state SMC_INIT before the connection is created, for instance in a non-blocking connect scenario.

This patch switches to non-zero values for the urg states.

Fixes de8474eb9d50 ("net/smc: urgent data support")

Applied and queued up for -stable.