lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 10 Feb 2012 12:39:29 -0800
From:	Jesse Barnes <jbarnes@...tuousgeek.org>
To:	Yinghai Lu <yinghai@...nel.org>
Cc:	Ram Pai <linuxram@...ibm.com>,
	Dominik Brodowski <linux@...inikbrodowski.net>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/9] PCI: Fix /sys warning when sriov enabled card is
 hot removed

On Sat,  4 Feb 2012 22:55:01 -0800
Yinghai Lu <yinghai@...nel.org> wrote:

> During recent strick checking about sysfs_remove from Eric.
> it will spit more bitter warning.
> 
> For SRIOV hotplug, we are calling pci_stop_dev() for VF at first.
> (after we update pci_stop_bus_devices).
> 
> that pci_stop_dev will calling device_unregiste for that VF, so that directory
> in VF is removed already.
> 
> We double checking if that VF dir in /sys is there, before try removing that
>  physfn link.
> 
> Signed-of-by: Yinghai Lu <yinghai@...nel.org>
> ---
>  drivers/pci/iov.c |    7 ++++++-
>  1 files changed, 6 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c
> index 0321fa3..dfc7d65 100644
> --- a/drivers/pci/iov.c
> +++ b/drivers/pci/iov.c
> @@ -173,7 +173,12 @@ static void virtfn_remove(struct pci_dev *dev, int id, int reset)
>  
>  	sprintf(buf, "virtfn%u", id);
>  	sysfs_remove_link(&dev->dev.kobj, buf);
> -	sysfs_remove_link(&virtfn->dev.kobj, "physfn");
> +	/*
> +	 * pci_stop_dev() could be called for this virtfn before already
> +	 *  so directory for the virtfn is removed before.
> +	 */
> +	if (virtfn->dev.kobj.sd)
> +		sysfs_remove_link(&virtfn->dev.kobj, "physfn");
>  
>  	mutex_lock(&iov->dev->sriov->lock);
>  	pci_remove_bus_device(virtfn);

Cleaned up the commit & comment text a bit and put into -next.  Please
check it out.

Thanks,
-- 
Jesse Barnes, Intel Open Source Technology Center

Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ