提交 818aa3ac 编写于 作者: U Ursula Braun 提交者: Xie XiuQi

net/smc: fix smc_poll in SMC_INIT state

mainline inclusion
from mainline-5.0
commit d7cf4a3bf3a8
category: bugfix
bugzilla: 10930
CVE: NA

-------------------------------------------------

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: NKarsten Graul <kgraul@linux.ibm.com>
Fixes: de8474eb ("net/smc: urgent data support")
Signed-off-by: NUrsula Braun <ubraun@linux.ibm.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
Signed-off-by: NZhiqiang Liu <liuzhiqiang26@huawei.com>
Reviewed-by: NWenan Mao <maowenan@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 645488bd
...@@ -113,9 +113,9 @@ struct smc_host_cdc_msg { /* Connection Data Control message */ ...@@ -113,9 +113,9 @@ struct smc_host_cdc_msg { /* Connection Data Control message */
} __aligned(8); } __aligned(8);
enum smc_urg_state { enum smc_urg_state {
SMC_URG_VALID, /* data present */ SMC_URG_VALID = 1, /* data present */
SMC_URG_NOTYET, /* data pending */ SMC_URG_NOTYET = 2, /* data pending */
SMC_URG_READ /* data was already read */ SMC_URG_READ = 3, /* data was already read */
}; };
struct smc_connection { struct smc_connection {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册