Re: [rdma/for-next v3 3/5] IB/{core,hw,sw}: pass uverbs_attr_bundle down ib_x destroy path

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

 



On Wed, Apr 17, 2019 at 11:02:38AM +0300, Gal Pressman wrote:
> On 31-Mar-19 19:10, Shamir Rabinovitch wrote:
> > the uverbs_attr_bundle with the ucontext is sent down to the drivers
> > ib_x destroy path as ib_udata. next patch will use the ib_udata to
> > free the drivers destroy path from the dependency in 'uobject->context'
> > as we already did for the create path.
> > 
> > Signed-off-by: Shamir Rabinovitch <shamir.rabinovitch@xxxxxxxxxx>
> 
> Hi Shamir,
> When running over for-next branch (with this patch), it looks like the driver
> udata passed to dereg_mr callback is corrupted (would expect it to
> be cleared),

Cleared as in equal to NULL or cleared as in the values of the
structure don't make sense?

Hum. There is this weird thing where methods that don't have a udata
defined don't always get a filled in udata pointer.

Does this fix it?

diff --git a/drivers/infiniband/core/uverbs_ioctl.c b/drivers/infiniband/core/uverbs_ioctl.c
index cfbef25b3a73af..829b0c6944d842 100644
--- a/drivers/infiniband/core/uverbs_ioctl.c
+++ b/drivers/infiniband/core/uverbs_ioctl.c
@@ -453,6 +453,8 @@ static int ib_uverbs_run_method(struct bundle_priv *pbundle,
 		uverbs_fill_udata(&pbundle->bundle,
 				  &pbundle->bundle.driver_udata,
 				  UVERBS_ATTR_UHW_IN, UVERBS_ATTR_UHW_OUT);
+	else
+		pbundle->bundle.driver_udata = (struct ib_udata){};
 
 	if (destroy_bkey != UVERBS_API_ATTR_BKEY_LEN) {
 		struct uverbs_obj_attr *destroy_attr =



[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