Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753612AbcD0Rlj (ORCPT ); Wed, 27 Apr 2016 13:41:39 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:46377 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752502AbcD0Rli (ORCPT ); Wed, 27 Apr 2016 13:41:38 -0400 Date: Wed, 27 Apr 2016 10:41:37 -0700 From: Greg KH To: "Simon A. F. Lund" Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, mb@lightnvm.io Subject: Re: [RFC PATCH] lightnvm: expose configuration through sysfs Message-ID: <20160427174137.GA10513@kroah.com> References: <1461777537-8145-1-git-send-email-slund@cnexlabs.com> <1461777537-8145-2-git-send-email-slund@cnexlabs.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1461777537-8145-2-git-send-email-slund@cnexlabs.com> User-Agent: Mutt/1.6.0 (2016-04-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1128 Lines: 42 On Wed, Apr 27, 2016 at 10:18:57AM -0700, Simon A. F. Lund wrote: > --- a/include/linux/lightnvm.h > +++ b/include/linux/lightnvm.h > @@ -174,6 +174,7 @@ struct nvm_id_group { > u16 cpar; > > struct nvm_id_lp_tbl lptbl; > + struct kobject kobj; > }; > > struct nvm_addr_format { > @@ -205,6 +206,7 @@ struct nvm_target { > struct list_head list; > struct nvm_tgt_type *type; > struct gendisk *disk; > + struct kobject kobj; > }; > > struct nvm_tgt_instance { > @@ -360,6 +362,8 @@ struct nvm_dev { > > struct mutex mlock; > spinlock_t lock; > + > + struct kobject kobj; > }; > > static inline struct ppa_addr generic_to_dev_addr(struct nvm_dev *dev, Never use "raw" kobjects in a driver for a device. You just guaranteed that userspace tools will not see these devices or attributes, which implies you didn't really test this using libudev :( Please use real devices, attached to the real devices your disks already have in the tree. And are you sure you didn't just mess up your reference counting by now having the lifecycle of these structures be dictated by the kobject? thanks, greg k-h