Re: [PATCH rdma-rc] IB/core: Don't match bond master filter for closed slaves

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

 



On Thu, Dec 06, 2018 at 12:19:30PM -0500, Doug Ledford wrote:
> On Wed, 2018-12-05 at 15:50 +0200, Leon Romanovsky wrote:
> > From: Mark Zhang <markz@xxxxxxxxxxxx>
> >
> > The "modprobe -r mlx4_en" will close bond slaves and in such
> > case the rdma_dev would be NULL, so no match should be returned.
>
> I'm not groking your commit message.  What happens without this patch?

We will see calltrace due to the fact that NULL is passed down the stack
through rdma_is_upper_dev_rcu() upto netdev_walk_all_upper_dev_rcu().

>
> > Fixes: 408f1242d940 ("IB/core: Delete lower netdevice default GID entries in bonding scenario")
> > Signed-off-by: Mark Zhang <markz@xxxxxxxxxxxx>
> > Reviewed-by: Parav Pandit <parav@xxxxxxxxxxxx>
> > Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxxxx>
> > ---
> >  drivers/infiniband/core/roce_gid_mgmt.c | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/drivers/infiniband/core/roce_gid_mgmt.c b/drivers/infiniband/core/roce_gid_mgmt.c
> > index 25d43c8f1c2a..558de0b9895c 100644
> > --- a/drivers/infiniband/core/roce_gid_mgmt.c
> > +++ b/drivers/infiniband/core/roce_gid_mgmt.c
> > @@ -267,6 +267,9 @@ is_upper_ndev_bond_master_filter(struct ib_device *ib_dev, u8 port,
> >  	struct net_device *cookie_ndev = cookie;
> >  	bool match = false;
> >
> > +	if (!rdma_ndev)
> > +		return false;
> > +
> >  	rcu_read_lock();
> >  	if (netif_is_bond_master(cookie_ndev) &&
> >  	    rdma_is_upper_dev_rcu(rdma_ndev, cookie_ndev))
>
> --
> Doug Ledford <dledford@xxxxxxxxxx>
>     GPG KeyID: B826A3330E572FDD
>     Key fingerprint = AE6B 1BDA 122B 23B4 265B  1274 B826 A333 0E57 2FDD


Attachment: signature.asc
Description: PGP signature


[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