netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 1/1] net/smc: fix smc_poll in SMC_INIT state
@ 2019-02-21 11:56 Ursula Braun
  2019-02-21 18:20 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Ursula Braun @ 2019-02-21 11:56 UTC (permalink / raw)
  To: davem; +Cc: netdev, linux-s390, schwidefsky, heiko.carstens, raspl, ubraun

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.

Reviewed-by: Karsten Graul <kgraul@linux.ibm.com>
Fixes: de8474eb9d50 ("net/smc: urgent data support")
Signed-off-by: Ursula Braun <ubraun@linux.ibm.com>
---
 net/smc/smc.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/smc/smc.h b/net/smc/smc.h
index 5721416d0605..adbdf195eb08 100644
--- a/net/smc/smc.h
+++ b/net/smc/smc.h
@@ -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 {
-- 
2.16.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net 1/1] net/smc: fix smc_poll in SMC_INIT state
  2019-02-21 11:56 [PATCH net 1/1] net/smc: fix smc_poll in SMC_INIT state Ursula Braun
@ 2019-02-21 18:20 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2019-02-21 18:20 UTC (permalink / raw)
  To: ubraun; +Cc: netdev, linux-s390, schwidefsky, heiko.carstens, raspl

From: Ursula Braun <ubraun@linux.ibm.com>
Date: Thu, 21 Feb 2019 12:56:54 +0100

> 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.
> 
> Reviewed-by: Karsten Graul <kgraul@linux.ibm.com>
> Fixes: de8474eb9d50 ("net/smc: urgent data support")
> Signed-off-by: Ursula Braun <ubraun@linux.ibm.com>

Applied and queued up for -stable.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-02-21 18:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-21 11:56 [PATCH net 1/1] net/smc: fix smc_poll in SMC_INIT state Ursula Braun
2019-02-21 18:20 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).