RE: [PATCH rdma-rc 9/9] IB/core: Fix missing RDMA cgroups release in case of failure to register device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Leon,

> -----Original Message-----
> From: Leon Romanovsky [mailto:leon@xxxxxxxxxx]
> Sent: Sunday, February 25, 2018 3:40 AM
> To: Doug Ledford <dledford@xxxxxxxxxx>; Jason Gunthorpe
> <jgg@xxxxxxxxxxxx>
> Cc: Leon Romanovsky <leon@xxxxxxxxxx>; RDMA mailing list <linux-
> rdma@xxxxxxxxxxxxxxx>; Boris Pismenny <borisp@xxxxxxxxxxxx>; Daniel
> Jurgens <danielj@xxxxxxxxxxxx>; Ilya Lesokhin <ilyal@xxxxxxxxxxxx>;
> Laurence Oberman <loberman@xxxxxxxxxx>; Majd Dibbiny
> <majd@xxxxxxxxxxxx>; Moni Shoua <monis@xxxxxxxxxxxx>; Noa Osherovich
> <noaos@xxxxxxxxxxxx>; Parav Pandit <parav@xxxxxxxxxxxx>; Sergey
> Gorenko <sergeygo@xxxxxxxxxxxx>; Yishai Hadas <yishaih@xxxxxxxxxxxx>
> Subject: [PATCH rdma-rc 9/9] IB/core: Fix missing RDMA cgroups release in case
> of failure to register device
> 
> From: Parav Pandit <parav@xxxxxxxxxxxx>
> 
> During IB device registration process, if query_device() fails or if ib_core fails to
> registers sysfs entries, rdma cgroup cleanup is skipped.
> 
> Cc: <stable@xxxxxxxxxxxxxxx> # v4.2+
rdma cgroup support was added in 4.11 kernel.
Shouldn't stable version be 4.11 or higher?

> Fixes: 4be3a4fa51f4 ("IB/core: Fix kernel crash during fail to initialize device")
> Reviewed-by: Daniel Jurgens <danielj@xxxxxxxxxxxx>
> Signed-off-by: Parav Pandit <parav@xxxxxxxxxxxx>
> Signed-off-by: Leon Romanovsky <leon@xxxxxxxxxx>
> ---
>  drivers/infiniband/core/device.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c
> index e8010e73a1cf..bb065c9449be 100644
> --- a/drivers/infiniband/core/device.c
> +++ b/drivers/infiniband/core/device.c
> @@ -536,14 +536,14 @@ int ib_register_device(struct ib_device *device,
>  	ret = device->query_device(device, &device->attrs, &uhw);
>  	if (ret) {
>  		pr_warn("Couldn't query the device attributes\n");
> -		goto cache_cleanup;
> +		goto cg_cleanup;
>  	}
> 
>  	ret = ib_device_register_sysfs(device, port_callback);
>  	if (ret) {
>  		pr_warn("Couldn't register device %s with driver model\n",
>  			device->name);
> -		goto cache_cleanup;
> +		goto cg_cleanup;
>  	}
> 
>  	device->reg_state = IB_DEV_REGISTERED; @@ -559,6 +559,8 @@ int
> ib_register_device(struct ib_device *device,
>  	mutex_unlock(&device_mutex);
>  	return 0;
> 
> +cg_cleanup:
> +	ib_device_unregister_rdmacg(device);
>  cache_cleanup:
>  	ib_cache_cleanup_one(device);
>  	ib_cache_release_one(device);
> --
> 2.16.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux