[PATCH RFC 2/9] migration/rdma: Fix wrong context in qio_channel_rdma_shutdown()

Peter Xu posted 9 patches 1 month ago
Maintainers: Alex Williamson <alex.williamson@redhat.com>, "Cédric Le Goater" <clg@redhat.com>, Hailiang Zhang <zhanghailiang@xfusion.com>, Peter Xu <peterx@redhat.com>, Fabiano Rosas <farosas@suse.de>, Li Zhijian <lizhijian@fujitsu.com>
[PATCH RFC 2/9] migration/rdma: Fix wrong context in qio_channel_rdma_shutdown()
Posted by Peter Xu 1 month ago
The rdmaout should be a cache of rioc->rdmaout, not rioc->rdmain.

Cc: Zhijian Li (Fujitsu) <lizhijian@fujitsu.com>
Cc: Lidong Chen <jemmy858585@gmail.com>
Fixes: 54db882f07 ("migration: implement the shutdown for RDMA QIOChannel")
Signed-off-by: Peter Xu <peterx@redhat.com>
---
 migration/rdma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/migration/rdma.c b/migration/rdma.c
index 2d839fce6c..e6837184c8 100644
--- a/migration/rdma.c
+++ b/migration/rdma.c
@@ -2986,7 +2986,7 @@ qio_channel_rdma_shutdown(QIOChannel *ioc,
     RCU_READ_LOCK_GUARD();
 
     rdmain = qatomic_rcu_read(&rioc->rdmain);
-    rdmaout = qatomic_rcu_read(&rioc->rdmain);
+    rdmaout = qatomic_rcu_read(&rioc->rdmaout);
 
     switch (how) {
     case QIO_CHANNEL_SHUTDOWN_READ:
-- 
2.50.1
Re: [PATCH RFC 2/9] migration/rdma: Fix wrong context in qio_channel_rdma_shutdown()
Posted by Zhijian Li (Fujitsu) 2 days, 14 hours ago

On 28/08/2025 04:59, Peter Xu wrote:
> The rdmaout should be a cache of rioc->rdmaout, not rioc->rdmain.
> 
> Cc: Zhijian Li (Fujitsu) <lizhijian@fujitsu.com>
> Cc: Lidong Chen <jemmy858585@gmail.com>
> Fixes: 54db882f07 ("migration: implement the shutdown for RDMA QIOChannel")
> Signed-off-by: Peter Xu <peterx@redhat.com>

Good catch.

Reviewed-by: Li Zhijian <lizhijian@fujitsu.com>


> ---
>   migration/rdma.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/migration/rdma.c b/migration/rdma.c
> index 2d839fce6c..e6837184c8 100644
> --- a/migration/rdma.c
> +++ b/migration/rdma.c
> @@ -2986,7 +2986,7 @@ qio_channel_rdma_shutdown(QIOChannel *ioc,
>       RCU_READ_LOCK_GUARD();
>   
>       rdmain = qatomic_rcu_read(&rioc->rdmain);
> -    rdmaout = qatomic_rcu_read(&rioc->rdmain);
> +    rdmaout = qatomic_rcu_read(&rioc->rdmaout);
>   
>       switch (how) {
>       case QIO_CHANNEL_SHUTDOWN_READ:
Re: [PATCH RFC 2/9] migration/rdma: Fix wrong context in qio_channel_rdma_shutdown()
Posted by Fabiano Rosas 1 week, 4 days ago
Peter Xu <peterx@redhat.com> writes:

> The rdmaout should be a cache of rioc->rdmaout, not rioc->rdmain.
>
> Cc: Zhijian Li (Fujitsu) <lizhijian@fujitsu.com>
> Cc: Lidong Chen <jemmy858585@gmail.com>
> Fixes: 54db882f07 ("migration: implement the shutdown for RDMA QIOChannel")
> Signed-off-by: Peter Xu <peterx@redhat.com>
> ---
>  migration/rdma.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/migration/rdma.c b/migration/rdma.c
> index 2d839fce6c..e6837184c8 100644
> --- a/migration/rdma.c
> +++ b/migration/rdma.c
> @@ -2986,7 +2986,7 @@ qio_channel_rdma_shutdown(QIOChannel *ioc,
>      RCU_READ_LOCK_GUARD();
>  
>      rdmain = qatomic_rcu_read(&rioc->rdmain);
> -    rdmaout = qatomic_rcu_read(&rioc->rdmain);
> +    rdmaout = qatomic_rcu_read(&rioc->rdmaout);
>  
>      switch (how) {
>      case QIO_CHANNEL_SHUTDOWN_READ:

Reviewed-by: Fabiano Rosas <farosas@suse.de>