Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp6563162imb; Fri, 8 Mar 2019 23:24:06 -0800 (PST) X-Google-Smtp-Source: APXvYqybjGUcoY0sjNav3m0YZuWyqRr3jLNr3z0+1M7rEBDPdXgkUav+gxy/qrnqDEooI+hd69O8 X-Received: by 2002:a63:d347:: with SMTP id u7mr20712923pgi.269.1552116246739; Fri, 08 Mar 2019 23:24:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1552116246; cv=none; d=google.com; s=arc-20160816; b=jB7DGp9YXzlmKcm8W1OmKS1BQMWQ+TQq4tDIU46FY5kCRMhq3H4Z/XWKLTkb06xXG9 3k3lBXeYrlkvS7VJhf35UxKZZBHVvlI+MfgZ4U9Qg2amIdquAjT8ZyOo6yL5/s24/FCD 2j6LsuKDSTzhTuCBk8jc5Z08Yw4+8MO3DNCTaQkU95hvJy7tRpT4+/bweFi0qc+ZArGf 9h8rUBw9Bi+fgolBIZsbGAIXJA/Ly2Un6js1qJud2sds0c8tlNsXpfcleH0kSn3YgZx8 WlhAQYBFWy+WsQ8iq+DpLnBcoN5nRGuoeQE3A7GsCcOf9QrDa8838iPLbqNDwzbSkRNP zUzw== 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=/e7ROEmYaeb761ULc18l5cb6mDIN7riUq06j8caIn6U=; b=Q88zLmdB+HYTqJzOn2/jTkxA5cUQg2HuAC87bd1uBnugqAV0bD4nbokyAkQ6ldKA6l /jVcDARcpG9zulSDNfQD0PhHGdsFYWaMUi9Rqg7UdCRhkez2h4j9Zd8TE7JF/8MnSt9/ lSkhkDjpmVtj9Kr+6KcjoFMIX/Gb/xkM0jNc68ljZ38xXJVfEo7k20JpvE6Hef2ndW3/ IuI7vNQ1kY5Op5w66BMswseWUEy131xBi9BABxYqtROjDLBr1qT/0XCcwb/oxZ3JSpdM dzZePntTcl+fMbHUiNgqV1ZIPsjoazIhqKoW/OyI+JeMzrXP17FkmltpyKAGZzbV6m47 I/qA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=srjpvoOq; 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 t3si8722771plq.430.2019.03.08.23.23.50; Fri, 08 Mar 2019 23:24:06 -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=srjpvoOq; 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 S1726821AbfCIHVj (ORCPT + 99 others); Sat, 9 Mar 2019 02:21:39 -0500 Received: from mail.kernel.org ([198.145.29.99]:43166 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725787AbfCIHVi (ORCPT ); Sat, 9 Mar 2019 02:21:38 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.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 6AB022081B; Sat, 9 Mar 2019 07:21:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1552116097; bh=qlv+LrDu6CgHaITWEndrpEiHYRBHefecu/t1KhNbGU4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=srjpvoOqsvXxd8+/KQo92zOr0aERrQDaDVpbajsiG19zsIwF3VJHQ+4XGEJzjK+Dn KeUSppvVG/ujqU2dNGF4OOQPfwr6e/40NXsTt5Gun2ErM/rZJQL01mdHDysjzv4iGV DAFTFODH9FN1RY7aOWoqxx7ilx1nMGJV4Qnq0fEs= Date: Sat, 9 Mar 2019 08:21:35 +0100 From: Greg KH To: Kimberly Brown 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: <20190309072135.GG3882@kroah.com> References: <20190301191824.GA4108@ubu-Virtual-Machine> <20190308224611.GA3047@ubu-Virtual-Machine> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190308224611.GA3047@ubu-Virtual-Machine> User-Agent: Mutt/1.11.3 (2019-02-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? > + > + 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? > + */ > + pr_err("Unable to set up channel sysfs files\n"); dev_err() to show who had the problem with the files? > + 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