Linux PCI subsystem development
 help / color / mirror / Atom feed
From: Wei Yang <weiyang@linux.vnet.ibm.com>
To: Bjorn Helgaas <bhelgaas@google.com>
Cc: Wei Yang <weiyang@linux.vnet.ibm.com>,
	Gavin Shan <gwshan@linux.vnet.ibm.com>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>
Subject: Re: [PATCH] pci/iov: return a reference to PF on destroying VF
Date: Thu, 7 May 2015 10:40:38 +0800	[thread overview]
Message-ID: <20150507024038.GB6645@richard> (raw)
In-Reply-To: <CAErSpo7oTxbThDGj6UkbpsAKBakkzJsq104swqsZWkr=0+dNkA@mail.gmail.com>

On Wed, May 06, 2015 at 10:23:26AM -0500, Bjorn Helgaas wrote:
>On Wed, May 6, 2015 at 2:25 AM, Wei Yang <weiyang@linux.vnet.ibm.com> wrote:
>> On Tue, May 05, 2015 at 04:29:05PM -0500, Bjorn Helgaas wrote:
>
>>>It would be useful to mention a way to cause the leak.  I suspect writing
>>>to a VF's sysfs "remove" file is the easiest.
>>>
>>
>> Looks a VF don't support the remove now.
>>
>> static umode_t pci_dev_hp_attrs_are_visible(struct kobject *kobj,
>>                                             struct attribute *a, int n)
>> {
>>         struct device *dev = container_of(kobj, struct device, kobj);
>>         struct pci_dev *pdev = to_pci_dev(dev);
>>
>>         if (pdev->is_virtfn)
>>                 return 0;
>>
>>         return a->mode;
>> }
>>
>> static struct attribute_group pci_dev_hp_attr_group = {
>>         .attrs = pci_dev_hp_attrs,
>>         .is_visible = pci_dev_hp_attrs_are_visible,
>> };
>
>Right, I forgot about this.  A VF has no "remove" file, so it can't be
>used to cause the leak.

Hmm, I see this is introduced in commit dfab88beda88, to prevent some memory
leak.

Could we say, if we do the release properly like in this patch, we could
re-enable this "remove"?

-- 
Richard Yang
Help you, Help me


  reply	other threads:[~2015-05-07  2:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-10  8:53 [PATCH] pci/iov: return a reference to PF on destroying VF Wei Yang
2015-05-05 21:29 ` Bjorn Helgaas
2015-05-06  6:09   ` Wei Yang
2015-05-06 15:30     ` Bjorn Helgaas
2015-05-07  2:35       ` Wei Yang
2015-05-06  7:25   ` Wei Yang
2015-05-06 15:23     ` Bjorn Helgaas
2015-05-07  2:40       ` Wei Yang [this message]
2015-05-08  3:53 ` [PATCH V2] pci/iov: fix resource leak " Wei Yang
2015-05-19 23:00   ` Bjorn Helgaas
2015-05-20  1:34     ` Wei Yang

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=20150507024038.GB6645@richard \
    --to=weiyang@linux.vnet.ibm.com \
    --cc=bhelgaas@google.com \
    --cc=gwshan@linux.vnet.ibm.com \
    --cc=linux-pci@vger.kernel.org \
    /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