From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 79CE2C17441 for ; Mon, 11 Nov 2019 17:29:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 50009214DB for ; Mon, 11 Nov 2019 17:29:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=networkplumber-org.20150623.gappssmtp.com header.i=@networkplumber-org.20150623.gappssmtp.com header.b="iacXhPkc" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727031AbfKKR36 (ORCPT ); Mon, 11 Nov 2019 12:29:58 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:41088 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726878AbfKKR35 (ORCPT ); Mon, 11 Nov 2019 12:29:57 -0500 Received: by mail-pf1-f194.google.com with SMTP id p26so11106476pfq.8 for ; Mon, 11 Nov 2019 09:29:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=fA7Fsg1gpMy56Uu36LA4owNDl1Jh20vv8x7SlaV4qs8=; b=iacXhPkc9FGy32VeGcUizlaxp9TQyTa3YCq/Mk6DC1chJi3XqsDkHLsbxG5ogjF7mL cHrCAE9nMRbY1ne2C3sr4IhOPaWJ2BRnmockFOBbL70I54EDazU88zBM3JO+CpK73UQ3 PodZNDoDnD8qH1DoJ1oiFoNgNkaTTyEFmoesB2/PI8l9OtBr5MTXGwh0+SkMxIIiKwBD oKc631VrVtl2JSu7Nt5yTatGHrE46KsgfPCuwoSyITvpyvrCJXb6MU68VvMyD0GnQNeq 2XLnaTQkBqfugUlXoMFeoT1nyAYH8VQDHPUEw3yCqSvvMO9cPzry4w02tpH4rmIb0xCh 76HQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fA7Fsg1gpMy56Uu36LA4owNDl1Jh20vv8x7SlaV4qs8=; b=TeU/4/8wAwIQaXGK7NyPVxoNXbql0WaJC44NeLuYI7PUR6xei+hwbRO8Pw3U2udkoz SepY+dThgMk9+QM/N0cNyPST320f+eWFOLdDWK1Hmx4pdlvJ9zjvg1uYbTylvn2T2zqU c2mo8M1TcbMawNUGXuJa7pYjhD2z5LgO3vw8phhwAqPKmi7SWTGttyKZVcaPyslYVhqQ MHxnDvbA8VfIRYkEc9a3LhiQhBGvZDKVpvvog6h4Iy6fnw0/omZ1t1+O+Pu+5HcxouKG L0DDE3CyrPX+Xlnfg+FF9111VTcWwhzd0VN/wNztRno42GnN3m9hL04NfdOXLXU3H5P0 jx1w== X-Gm-Message-State: APjAAAUWrmalyfeEP5FY7GkiC8eBftfpVhrZ6dm5LEUUhUQJVyQetgdm dnciLx115+ANTd1YXAHyScmMRQ== X-Google-Smtp-Source: APXvYqz/ZDi0j4sGOiniVLuzA+Rs8BpMrp5miPmhe+9uGIOTxXjJNz7l6UCNqvoKgWBmZet2LW3hWA== X-Received: by 2002:a63:7015:: with SMTP id l21mr27824906pgc.200.1573493397028; Mon, 11 Nov 2019 09:29:57 -0800 (PST) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id r184sm17589538pfc.106.2019.11.11.09.29.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Nov 2019 09:29:56 -0800 (PST) Date: Mon, 11 Nov 2019 09:29:48 -0800 From: Stephen Hemminger To: Greg KH 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: <20191111092948.047f1708@hermes.lan> In-Reply-To: <20191111172322.GB1077444@kroah.com> References: <20191111084507.9286-1-Tianyu.Lan@microsoft.com> <20191111094920.GA135867@kroah.com> <20191111084712.37ba7d5a@hermes.lan> <20191111172322.GB1077444@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 11 Nov 2019 18:23:22 +0100 Greg KH 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" 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?