> -----Original Message----- > From: Jiri Pirko <jiri@xxxxxxxxxxx> > Sent: Friday, November 8, 2019 4:50 AM > To: Parav Pandit <parav@xxxxxxxxxxxx> > Cc: alex.williamson@xxxxxxxxxx; davem@xxxxxxxxxxxxx; > kvm@xxxxxxxxxxxxxxx; netdev@xxxxxxxxxxxxxxx; Saeed Mahameed > <saeedm@xxxxxxxxxxxx>; kwankhede@xxxxxxxxxx; leon@xxxxxxxxxx; > cohuck@xxxxxxxxxx; Jiri Pirko <jiri@xxxxxxxxxxxx>; linux- > rdma@xxxxxxxxxxxxxxx > Subject: Re: [PATCH net-next 08/19] vfio/mdev: Make mdev alias unique > among all mdevs > > Thu, Nov 07, 2019 at 05:08:23PM CET, parav@xxxxxxxxxxxx wrote: > >Mdev alias should be unique among all the mdevs, so that when such > >alias is used by the mdev users to derive other objects, there is no > >collision in a given system. > > > >Reviewed-by: Saeed Mahameed <saeedm@xxxxxxxxxxxx> > >Signed-off-by: Parav Pandit <parav@xxxxxxxxxxxx> > >--- > > drivers/vfio/mdev/mdev_core.c | 7 +++++++ > > 1 file changed, 7 insertions(+) > > > >diff --git a/drivers/vfio/mdev/mdev_core.c > >b/drivers/vfio/mdev/mdev_core.c index 3bdff0469607..c8cd40366783 > 100644 > >--- a/drivers/vfio/mdev/mdev_core.c > >+++ b/drivers/vfio/mdev/mdev_core.c > >@@ -388,6 +388,13 @@ int mdev_device_create(struct kobject *kobj, struct > device *dev, > > ret = -EEXIST; > > goto mdev_fail; > > } > >+ if (alias && tmp->alias && !strcmp(alias, tmp->alias)) { > >+ mutex_unlock(&mdev_list_lock); > >+ ret = -EEXIST; > >+ dev_dbg_ratelimited(dev, "Hash collision in alias > creation for UUID %pUl\n", > >+ uuid); > >+ goto mdev_fail; > >+ } > > I don't understand why this needs to be a separate patch. This check seems > to be an inseparable part of mdev alias feature. > Please squash to the previous patch. > Ok. Cornelia had the same comment too. The previous patch had relatively more delta, and since this patch can be split functionally, I kept it as separate one. Either way works. > > > } > > > > mdev = kzalloc(sizeof(*mdev), GFP_KERNEL); > >-- > >2.19.2 > >