Message ID | 1524725184-79590-2-git-send-email-oulijun@huawei.com (mailing list archive) |
---|---|
State | Deferred |
Headers | show |
On Thu, Apr 26, 2018 at 02:46:14PM +0800, Lijun Ou wrote: > > Signed-off-by: Lijun Ou <oulijun@huawei.com> > Signed-off-by: Leon Romanovsky <leonro@mellanox.com> > Tested-by: Lijun Ou <oulijun@huawei.com> > --- > drivers/infiniband/core/uverbs_std_types_dm.c | 7 ++++++- > drivers/infiniband/core/verbs.c | 3 --- > 2 files changed, 6 insertions(+), 4 deletions(-) > Lijun, sorry for not updating you, but this patch is incorrect. Ariel is working to provide proper fix. Thanks
在 2018/4/26 15:50, Leon Romanovsky 写道: > On Thu, Apr 26, 2018 at 02:46:14PM +0800, Lijun Ou wrote: >> >> Signed-off-by: Lijun Ou <oulijun@huawei.com> >> Signed-off-by: Leon Romanovsky <leonro@mellanox.com> >> Tested-by: Lijun Ou <oulijun@huawei.com> >> --- >> drivers/infiniband/core/uverbs_std_types_dm.c | 7 ++++++- >> drivers/infiniband/core/verbs.c | 3 --- >> 2 files changed, 6 insertions(+), 4 deletions(-) >> > > Lijun, sorry for not updating you, but this patch is incorrect. > > Ariel is working to provide proper fix. > > Thanks > Ok. I am tested gived by your modification. if Ariel will do, please ignore it. -- 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
diff --git a/drivers/infiniband/core/uverbs_std_types_dm.c b/drivers/infiniband/core/uverbs_std_types_dm.c index 8b68157..b83ccbd 100644 --- a/drivers/infiniband/core/uverbs_std_types_dm.c +++ b/drivers/infiniband/core/uverbs_std_types_dm.c @@ -37,11 +37,16 @@ static int uverbs_free_dm(struct ib_uobject *uobject, enum rdma_remove_reason why) { struct ib_dm *dm = uobject->object; + int ret; if (why == RDMA_REMOVE_DESTROY && atomic_read(&dm->usecnt)) return -EBUSY; - return dm->device->dealloc_dm(dm); + ret = dm->device->dealloc_dm(dm); + if (!ret) + atomic_dec(&dm->usecnt); + + return ret; } static int UVERBS_HANDLER(UVERBS_METHOD_DM_ALLOC)(struct ib_device *ib_dev, diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c index 7eff3ae..50a3b20 100644 --- a/drivers/infiniband/core/verbs.c +++ b/drivers/infiniband/core/verbs.c @@ -1616,15 +1616,12 @@ int ib_resize_cq(struct ib_cq *cq, int cqe) int ib_dereg_mr(struct ib_mr *mr) { struct ib_pd *pd = mr->pd; - struct ib_dm *dm = mr->dm; int ret; rdma_restrack_del(&mr->res); ret = mr->device->dereg_mr(mr); if (!ret) { atomic_dec(&pd->usecnt); - if (dm) - atomic_dec(&dm->usecnt); } return ret;