From: Stephen Hemminger <stephen@networkplumber.org>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: lantianyu1986@gmail.com, alex.williamson@redhat.com,
cohuck@redhat.com, KY Srinivasan <kys@microsoft.com>,
Haiyang Zhang <haiyangz@microsoft.com>,
Stephen Hemminger <sthemmin@microsoft.com>,
sashal@kernel.org, mchehab+samsung@kernel.org,
davem@davemloft.net, robh@kernel.org,
Jonathan.Cameron@huawei.com, paulmck@linux.ibm.com,
Michael Kelley <mikelley@microsoft.com>,
Tianyu Lan <Tianyu.Lan@microsoft.com>,
linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
linux-hyperv@vger.kernel.org, vkuznets <vkuznets@redhat.com>
Subject: Re: [PATCH] VFIO/VMBUS: Add VFIO VMBUS driver support
Date: Mon, 11 Nov 2019 09:29:48 -0800 [thread overview]
Message-ID: <20191111092948.047f1708@hermes.lan> (raw)
In-Reply-To: <20191111172322.GB1077444@kroah.com>
On Mon, 11 Nov 2019 18:23:22 +0100
Greg KH <gregkh@linuxfoundation.org> wrote:
> On Mon, Nov 11, 2019 at 08:47:12AM -0800, Stephen Hemminger wrote:
> > On Mon, 11 Nov 2019 01:49:20 -0800
> > "Greg KH" <gregkh@linuxfoundation.org> wrote:
> >
> > > > + ret = sysfs_create_bin_file(&channel->kobj,
> > > &ring_buffer_bin_attr);
> > > > + if (ret)
> > > > + dev_notice(&dev->device,
> > > > + "sysfs create ring bin file failed; %d\n",
> > > ret);
> > > > +
> > >
> > > Again, don't create sysfs files on your own, the bus code should be
> > > doing this for you automatically and in a way that is race-free.
> > >
> > > thanks,
> > >
> > > greg k-h
> >
> > The sysfs file is only created if the VFIO/UIO driveris used.
>
> That's even worse. Again, sysfs files should be automatically created
> by the driver core when the device is created. To randomly add/remove
> random files after that happens means userspace is never notified of
> that and that's not good.
>
> We've been working for a while to fix up these types of races, don't
> purposfully add new ones for no good reason please :)
>
> thanks,
>
> greg k-h
The handler for this sysfs file is in the vfio (and uio) driver.
How would this work if bus handled it?
next prev parent reply other threads:[~2019-11-11 17:29 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-11 8:45 [PATCH] VFIO/VMBUS: Add VFIO VMBUS driver support lantianyu1986
2019-11-11 9:49 ` Greg KH
2019-11-11 16:47 ` Stephen Hemminger
2019-11-11 17:23 ` Greg KH
2019-11-11 17:29 ` Stephen Hemminger [this message]
2019-11-19 23:37 ` Michael Kelley
2019-11-19 23:56 ` Alex Williamson
2019-11-20 18:35 ` Stephen Hemminger
2019-11-20 19:07 ` Alex Williamson
2019-11-20 19:46 ` Stephen Hemminger
2019-11-20 20:31 ` Alex Williamson
2019-11-20 23:18 ` Stephen Hemminger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191111092948.047f1708@hermes.lan \
--to=stephen@networkplumber.org \
--cc=Jonathan.Cameron@huawei.com \
--cc=Tianyu.Lan@microsoft.com \
--cc=alex.williamson@redhat.com \
--cc=cohuck@redhat.com \
--cc=davem@davemloft.net \
--cc=gregkh@linuxfoundation.org \
--cc=haiyangz@microsoft.com \
--cc=kvm@vger.kernel.org \
--cc=kys@microsoft.com \
--cc=lantianyu1986@gmail.com \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mchehab+samsung@kernel.org \
--cc=mikelley@microsoft.com \
--cc=paulmck@linux.ibm.com \
--cc=robh@kernel.org \
--cc=sashal@kernel.org \
--cc=sthemmin@microsoft.com \
--cc=vkuznets@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).