[PATCH 02/11] drbd_receiver: get_ldev before use device->ldev for drbd_reconsider_queue_parameters()
Philipp Reisner
philipp.reisner at linbit.com
Fri Jun 28 11:35:54 CEST 2024
Thanks.
On Mon, Jun 24, 2024 at 8:32 AM zhengbing.huang
<zhengbing.huang at easystack.cn> wrote:
>
> From: Dongsheng Yang <dongsheng.yang at easystack.cn>
>
> check ldev is not NULL before use it in drbd_reconsider_queue_parameters()
>
> Signed-off-by: Dongsheng Yang <dongsheng.yang at easystack.cn>
> ---
> drbd/drbd_receiver.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drbd/drbd_receiver.c b/drbd/drbd_receiver.c
> index 49e7815ed..fd07b29d7 100644
> --- a/drbd/drbd_receiver.c
> +++ b/drbd/drbd_receiver.c
> @@ -9845,7 +9845,12 @@ static void conn_disconnect(struct drbd_connection *connection)
> rcu_read_unlock();
>
> peer_device_disconnected(peer_device);
> - drbd_reconsider_queue_parameters(device, device->ldev);
> + if (get_ldev(device)) {
> + drbd_reconsider_queue_parameters(device, device->ldev);
> + put_ldev(device);
> + } else {
> + drbd_reconsider_queue_parameters(device, NULL);
> + }
>
> kref_put(&device->kref, drbd_destroy_device);
> rcu_read_lock();
> --
> 2.27.0
>
More information about the drbd-dev
mailing list