diff mbox

IB/core: Fix missed clean call in registration path

Message ID 1456071146-28101-1-git-send-email-leonro@mellanox.com (mailing list archive)
State Accepted
Headers show

Commit Message

Leon Romanovsky Feb. 21, 2016, 4:12 p.m. UTC
In case of failure returned from query function in
IB device registration, we need to clean IB cache which
was missed.

This change fixes it.

Fixes: 3e153a93a1c1 ('IB/core: Save the device attributes on the device
structure')
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
 drivers/infiniband/core/device.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Ira Weiny Feb. 22, 2016, 1:13 a.m. UTC | #1
On Sun, Feb 21, 2016 at 06:12:26PM +0200, Leon Romanovsky wrote:
> In case of failure returned from query function in
> IB device registration, we need to clean IB cache which
> was missed.
> 
> This change fixes it.
> 
> Fixes: 3e153a93a1c1 ('IB/core: Save the device attributes on the device
> structure')
> Signed-off-by: Leon Romanovsky <leonro@mellanox.com>

Reviewed-by: Ira Weiny <ira.weiny@intel.com>

> ---
>  drivers/infiniband/core/device.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c
> index 00da80e..94b80a5 100644
> --- a/drivers/infiniband/core/device.c
> +++ b/drivers/infiniband/core/device.c
> @@ -358,6 +358,7 @@ int ib_register_device(struct ib_device *device,
>  	ret = device->query_device(device, &device->attrs, &uhw);
>  	if (ret) {
>  		printk(KERN_WARNING "Couldn't query the device attributes\n");
> +		ib_cache_cleanup_one(device);
>  		goto out;
>  	}
>  
> -- 
> 2.1.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sagi Grimberg Feb. 22, 2016, 8:31 a.m. UTC | #2
Looks fine,

Reviewed-by: Sagi Grimberg <sagig@mellanox.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Leon Romanovsky Feb. 22, 2016, 8:53 a.m. UTC | #3
On Sun, Feb 21, 2016 at 08:13:36PM -0500, ira.weiny wrote:
> On Sun, Feb 21, 2016 at 06:12:26PM +0200, Leon Romanovsky wrote:
> > In case of failure returned from query function in
> > IB device registration, we need to clean IB cache which
> > was missed.
> > 
> > This change fixes it.
> > 
> > Fixes: 3e153a93a1c1 ('IB/core: Save the device attributes on the device
> > structure')
> > Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
> 
> Reviewed-by: Ira Weiny <ira.weiny@intel.com>
> Reviewed-by: Sagi Grimberg <sagig@mellanox.com>
> 

Thanks Ira and Sagi,
Do you see the need to push this fix to -stable too?
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Or Gerlitz Feb. 22, 2016, 9:12 a.m. UTC | #4
On Mon, Feb 22, 2016 at 10:53 AM, Leon Romanovsky <leon@leon.nu> wrote:
> On Sun, Feb 21, 2016 at 08:13:36PM -0500, ira.weiny wrote:
>> On Sun, Feb 21, 2016 at 06:12:26PM +0200, Leon Romanovsky wrote:
>> > In case of failure returned from query function in
>> > IB device registration, we need to clean IB cache which
>> > was missed.
>> >
>> > This change fixes it.
>> >
>> > Fixes: 3e153a93a1c1 ('IB/core: Save the device attributes on the device
>> > structure')
>> > Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
>>
>> Reviewed-by: Ira Weiny <ira.weiny@intel.com>
>> Reviewed-by: Sagi Grimberg <sagig@mellanox.com>
>>
>
> Thanks Ira and Sagi,
> Do you see the need to push this fix to -stable too?

$ git tag --contains 3e153a93a1c1
v4.5-rc1
v4.5-rc2
v4.5-rc3
v4.5-rc4
v4.5-rc5
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Leon Romanovsky Feb. 22, 2016, 9:25 a.m. UTC | #5
On Mon, Feb 22, 2016 at 11:12:46AM +0200, Or Gerlitz wrote:
> On Mon, Feb 22, 2016 at 10:53 AM, Leon Romanovsky <leon@leon.nu> wrote:
> > On Sun, Feb 21, 2016 at 08:13:36PM -0500, ira.weiny wrote:
> >> On Sun, Feb 21, 2016 at 06:12:26PM +0200, Leon Romanovsky wrote:
> >> > In case of failure returned from query function in
> >> > IB device registration, we need to clean IB cache which
> >> > was missed.
> >> >
> >> > This change fixes it.
> >> >
> >> > Fixes: 3e153a93a1c1 ('IB/core: Save the device attributes on the device
> >> > structure')
> >> > Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
> >>
> >> Reviewed-by: Ira Weiny <ira.weiny@intel.com>
> >> Reviewed-by: Sagi Grimberg <sagig@mellanox.com>
> >>
> >
> > Thanks Ira and Sagi,
> > Do you see the need to push this fix to -stable too?
> 
> $ git tag --contains 3e153a93a1c1
> v4.5-rc1
> v4.5-rc2
> v4.5-rc3
> v4.5-rc4
> v4.5-rc5

Thanks a lot for pointing it out to me.
You are great
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Doug Ledford March 3, 2016, 10:03 p.m. UTC | #6
On 02/22/2016 03:31 AM, Sagi Grimberg wrote:
> Looks fine,
> 
> Reviewed-by: Sagi Grimberg <sagig@mellanox.com>

This was picked up for late 4.5-rc
diff mbox

Patch

diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c
index 00da80e..94b80a5 100644
--- a/drivers/infiniband/core/device.c
+++ b/drivers/infiniband/core/device.c
@@ -358,6 +358,7 @@  int ib_register_device(struct ib_device *device,
 	ret = device->query_device(device, &device->attrs, &uhw);
 	if (ret) {
 		printk(KERN_WARNING "Couldn't query the device attributes\n");
+		ib_cache_cleanup_one(device);
 		goto out;
 	}