Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp6460208ybx; Mon, 11 Nov 2019 09:27:05 -0800 (PST) X-Google-Smtp-Source: APXvYqzxQqKhlr0EBabTQTaBKOZf9CuJV7zy9J2Jn5qoQ4rqcwhvatVnKWL6NBlRWXxQoP1yUmJt X-Received: by 2002:a17:906:4d93:: with SMTP id s19mr24021641eju.285.1573493225812; Mon, 11 Nov 2019 09:27:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573493225; cv=none; d=google.com; s=arc-20160816; b=0gQZLQ9q5B/h+OvLcR36IXagM124hZEk2yhCrFgsDBR3zkdyCOcdk9aFMdap84Nxha TL13QGxHdwM4no+cFpwxkgFUj8ZdDKePA+769edjPMca8aro1VN9VLAQTGAarJETeGjN RT+aehBI9quXhoBkc4jaxD0atJu7Xp4OOUUFTVwacBuzXmJiAXESPuaZIsm1mDKGg0CW 1kWcriJ/B/qFJyoeNpEktFBSVyK9Kwfyb5Uj/DfBL6tmtOO80QjzNnrKk2NRXqkkHquL ypL36Eo7DBGyTOHKd9al4q2LHtIh9i/l9eB5oHYeU0yJ7J6uq+GokfXlpFkYvZo6bPso CNkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=PBobQCK8uup8hvjeO2bpn41io50zQTVa7m7m3OUUpYg=; b=ekiVTj4XCq7OGAjsiCtdCB2+rVEdNt1+Q6GKUOJV16ByD0mp71mZ5aExnCOuhkWzXQ 92HZaW5BA9ZxDO+BdwcARbFLFRcS063fbcpwABwLCA5zMIJv8gBvj/oGAnsPlqWGTRpa HhF/Rpc+wFYQnZ/q879l95viCBKnPJWQqkBMxHOXDWfhWfzFAwig0UgUV4rOHCEPYX2A nhWN0jMZKvtOYp31rueSWKvwlowd2aiSO9/TdKLb8V88J0ybe0adwwNXxho4TZhwEYBu /7Avzi3Zle8f5tuk0OL1i+eWAUtIaNfRpDTu5vYnTfHdR7UlYHZcjZSHAbCNlG8zz+od LYvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VcdI+yQ6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id qn27si4514062ejb.426.2019.11.11.09.26.41; Mon, 11 Nov 2019 09:27:05 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VcdI+yQ6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727074AbfKKRXZ (ORCPT + 99 others); Mon, 11 Nov 2019 12:23:25 -0500 Received: from mail.kernel.org ([198.145.29.99]:32972 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726960AbfKKRXZ (ORCPT ); Mon, 11 Nov 2019 12:23:25 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2536A214DB; Mon, 11 Nov 2019 17:23:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573493004; bh=FdXhlcSnmQXZ512UJAwnB/JLm0W9BnHa+GET9e6BVV8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=VcdI+yQ6JQj+/B1nStLolWUligtFElZUe7UsWr7g/kmdLjIhj6L9UgPV9fWDeYY2d IrSwoefmKTdFqj1LjlY0Z/EicQr+OA4Rrcr4EYpw7cpyzDLOM1oP4opT7UDKwjs6ij GMLfc6i277bBXRE4ZSOEDrxjN96fjopM6xkMbMKc= Date: Mon, 11 Nov 2019 18:23:22 +0100 From: Greg KH To: Stephen Hemminger Cc: lantianyu1986@gmail.com, alex.williamson@redhat.com, cohuck@redhat.com, KY Srinivasan , Haiyang Zhang , Stephen Hemminger , sashal@kernel.org, mchehab+samsung@kernel.org, davem@davemloft.net, robh@kernel.org, Jonathan.Cameron@huawei.com, paulmck@linux.ibm.com, Michael Kelley , Tianyu Lan , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-hyperv@vger.kernel.org, vkuznets Subject: Re: [PATCH] VFIO/VMBUS: Add VFIO VMBUS driver support Message-ID: <20191111172322.GB1077444@kroah.com> References: <20191111084507.9286-1-Tianyu.Lan@microsoft.com> <20191111094920.GA135867@kroah.com> <20191111084712.37ba7d5a@hermes.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191111084712.37ba7d5a@hermes.lan> User-Agent: Mutt/1.12.2 (2019-09-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 11, 2019 at 08:47:12AM -0800, Stephen Hemminger wrote: > On Mon, 11 Nov 2019 01:49:20 -0800 > "Greg KH" 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