relay: fix cpu offline problem

relay_open() will close allocated buffers when failed.
but if cpu offlined, some buffer will not be closed.
this patch fixed it.

and did cleanup for relay_reset() too.

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>

authored by Lai Jiangshan and committed by Jens Axboe 98ba4031 68aee07f

+4 -5
+4 -5
kernel/relay.c
··· 400 400 } 401 401 402 402 mutex_lock(&relay_channels_mutex); 403 - for_each_online_cpu(i) 403 + for_each_possible_cpu(i) 404 404 if (chan->buf[i]) 405 405 __relay_reset(chan->buf[i], 0); 406 406 mutex_unlock(&relay_channels_mutex); ··· 611 611 return chan; 612 612 613 613 free_bufs: 614 - for_each_online_cpu(i) { 615 - if (!chan->buf[i]) 616 - break; 617 - relay_close_buf(chan->buf[i]); 614 + for_each_possible_cpu(i) { 615 + if (chan->buf[i]) 616 + relay_close_buf(chan->buf[i]); 618 617 } 619 618 620 619 kref_put(&chan->kref, relay_destroy_channel);