Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp1553089imc; Mon, 11 Mar 2019 17:05:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqwbCak1VQnrXrFiz3ebWQXbSa5iO4ZSAwzpDEmaJ8FemOQxvYOCFtmOox6rzhz2ihoJtBvm X-Received: by 2002:a63:d453:: with SMTP id i19mr32231632pgj.237.1552349131592; Mon, 11 Mar 2019 17:05:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552349131; cv=none; d=google.com; s=arc-20160816; b=HS1fjPydVlR9RFxs17Xub/cpw767zbD9/qwcUTdkym6759GTC5dgJzCtXWvpaxIdRs iuea2kYAR429FSTrC/PIY4fNbIHN1btr7s263bdF1rl9grQ5v6Dw69a41Fst+QJbDgLT +RBmjDXjpN6qMEQaG18Kp6Q0r9317N4GCrd5ICmGC+TCiF4LwYJxPt6+VwW7/eLYVGx0 TCcfMiOhkgLdph1WBRSfTXvmswMjVlvnq/Pf2yFqIiKzkFofbCHF/Wbx8lqHBDlw1Sdv WL8tlijTR1XGBND/9WhsvoatJAsHCasQgbT+81b4D92cUQ3Q0GkdFQmDNktb5mwCUTEg ltmg== 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=2/2Qa2e4UEqK/boVPhIKwaqF0oM6VtVD5qsDfr70Dho=; b=jXuTyrEPCg/FQkbeD/3BijpWeMJ7qNsKY4oRhvJxwqT28JgE10/VM8gKdj0dHFD1Ii mBVfiejXvBaYenkD+VcTmrjNcgoph6wctVmIIpf2Ja0ylFK5ei7WE2Qhrk/hY4deSCev kH0UR6NZd99WJMUTD84aa++jvsnjVWn2rlvP3nSWnIdcuAS1UVHGfOsJzFXq+GUUiPjn sekrLhuDgIw4q3od3gzzlOjyA/3hqVZte/1Y57D9A+b87NwaE+hSSll0rtzX/fmaBDLu tGdI7lQFsRPT3AOelUJ9NkmTAhZXn0aoR4R7bFsQKswjbLESeOZICzJ43+epbwt9Pn0Y vx1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mRq2K6gI; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n14si5782684pgv.520.2019.03.11.17.05.14; Mon, 11 Mar 2019 17:05:31 -0700 (PDT) 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=@gmail.com header.s=20161025 header.b=mRq2K6gI; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726167AbfCLAEz (ORCPT + 99 others); Mon, 11 Mar 2019 20:04:55 -0400 Received: from mail-it1-f195.google.com ([209.85.166.195]:53587 "EHLO mail-it1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725850AbfCLAEy (ORCPT ); Mon, 11 Mar 2019 20:04:54 -0400 Received: by mail-it1-f195.google.com with SMTP id x189so1569693itd.3; Mon, 11 Mar 2019 17:04:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=2/2Qa2e4UEqK/boVPhIKwaqF0oM6VtVD5qsDfr70Dho=; b=mRq2K6gITp61ApN0SLj4S9OAELSAcR8/59tG2kyQZVSHEjGwC2rEBEUPXPDx+zNZvO eHD6v7/RbUEwR7Bhg5PrwgSEKeFOrcCxC1keBovmW9YULHcbmEPrsFWlFjp4o6UJd2i6 YXgOFc9O0xA18SCJdFHqZx+nOY/A84tdTbisYCx2vJ/eXyui2oQFBZbHj9PtGpRiFLYi rWfsOXNUi1AdO9Zf8nGvRHUvkoeOMBYCwcl6CAp0s+9v0sC9EvUv5dMpTwcUOtHTO7yM woroS54Ua/ASXjwae3vkHjTQxoWty9yGiCJ2CJ1Nq2/qqzL5dRkKGUPq9sWUVZt58y/n cacg== 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:references :mime-version:content-disposition:in-reply-to:user-agent; bh=2/2Qa2e4UEqK/boVPhIKwaqF0oM6VtVD5qsDfr70Dho=; b=c2FsJ77RkX+ATvC578Z0/IyuTcJ9jkWGq7W/FLJL8ItFgLpMOYKSl5V2HyRl4NqKZe +M3nXY3AWmdBfw21S6SjJGQfWeYLAe9XhujJp1CAz52ikpsQNSIfBTTSSeKxaZsMbwp+ +hg8ebd5r05kkqxfB182/rNj3UCogBPqndcvByrKkshF7r10TvP98SDuPS230YhDKYxe WDwzgEO2AVGmPCuhnMhbwIz4ZHe4qfvigx6Q8qKvs4V40CJzapYeZB2O2HlK67gebKjk gdY2x+Uz8ry5gR9g37Rtb71bC31eBNoRIMrb6oxYNEf1i2a/O7Wv/XKvTgyeZdNVLEQJ z2TA== X-Gm-Message-State: APjAAAVRb/UWo6HBqDJ/RVPf6fMePhfJkS8adfm5beUVo4uSf7lSq2Q0 f9eG1Eol9UCoBt1j3OKDvOg= X-Received: by 2002:a24:4290:: with SMTP id i138mr542504itb.24.1552349093561; Mon, 11 Mar 2019 17:04:53 -0700 (PDT) Received: from ubu-Virtual-Machine (66-188-57-61.dhcp.bycy.mi.charter.com. [66.188.57.61]) by smtp.gmail.com with ESMTPSA id d139sm430774itc.44.2019.03.11.17.04.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 11 Mar 2019 17:04:52 -0700 (PDT) Date: Mon, 11 Mar 2019 20:04:50 -0400 From: Kimberly Brown To: Greg KH Cc: Michael Kelley , Long Li , Sasha Levin , Stephen Hemminger , Dexuan Cui , "K. Y. Srinivasan" , Haiyang Zhang , linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5] Drivers: hv: vmbus: Expose monitor data only when monitor pages are used Message-ID: <20190312000449.GA2741@ubu-Virtual-Machine> References: <20190301191824.GA4108@ubu-Virtual-Machine> <20190308224611.GA3047@ubu-Virtual-Machine> <20190309072135.GG3882@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190309072135.GG3882@kroah.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Mar 09, 2019 at 08:21:35AM +0100, Greg KH wrote: > On Fri, Mar 08, 2019 at 05:46:11PM -0500, Kimberly Brown wrote: > > static struct kobj_type vmbus_chan_ktype = { > > .sysfs_ops = &vmbus_chan_sysfs_ops, > > .release = vmbus_chan_release, > > - .default_attrs = vmbus_chan_attrs, > > As discussed on IRC, a kobj_type needs to get an attribute group one of > these days, not just a attribute list :) > > So thanks for persisting with this, sorry for the earlier review > comments, you were totally right about this, nice work. > > Minor review comments below: > > > }; > > > > /* > > @@ -1571,11 +1624,34 @@ int vmbus_add_channel_kobj(struct hv_device *dev, struct vmbus_channel *channel) > > if (ret) > > return ret; > > > > + ret = sysfs_create_group(kobj, &vmbus_chan_group); > > + channel->sysfs_group_ready = !ret; > > Why do you need this flag? > I added this flag to prevent sysfs_remove_group() from being called if sysfs_create_group() or the earlier call to kobject_init_and_add() failed. However, it looks like that would just lead to WARN() being called, which seems appropriate. I'll remove this flag. > > + > > + if (ret) { > > + /* > > + * If an error is returned to the calling functions, those > > + * functions will call kobject_put() on the channel kobject, > > + * which will cleanup the empty channel directory created by > > + * kobject_init_and_add(). > > Why is this comment needed? > Another reviewer asked why the empty directory created by kobject_init_and_add() isn't removed here when sysfs_create_group() fails. We decided that a comment would help clear up any future confusion. > > + */ > > + pr_err("Unable to set up channel sysfs files\n"); > > dev_err() to show who had the problem with the files? > Yes, good point. I'll change this. > > + return ret; > > + } > > + > > kobject_uevent(kobj, KOBJ_ADD); > > > > return 0; > > } > > > > +/* > > + * vmbus_remove_channel_attr_group - remove the channel's attribute group > > + */ > > +void vmbus_remove_channel_attr_group(struct vmbus_channel *channel) > > +{ > > + if (channel->sysfs_group_ready) > > + sysfs_remove_group(&channel->kobj, &vmbus_chan_group); > > You should be able to just always remove these, no need for a flag to > say you have created them or not, right? > > thanks, > > greg k-h