From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751029AbdBKSnn (ORCPT ); Sat, 11 Feb 2017 13:43:43 -0500 Received: from ale.deltatee.com ([207.54.116.67]:42564 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750778AbdBKSnm (ORCPT ); Sat, 11 Feb 2017 13:43:42 -0500 To: Dan Williams References: <1486754370-3057-1-git-send-email-logang@deltatee.com> <20170210201737.GA15397@kroah.com> <20170211071619.GA1345@kroah.com> Cc: Greg Kroah-Hartman , Johannes Thumshirn , "Paul E. McKenney" , Sajjan Vikas C , Arnd Bergmann , Jan Kara , "linux-kernel@vger.kernel.org" , "linux-nvdimm@lists.01.org" From: Logan Gunthorpe Message-ID: <2358f952-5376-dd34-0694-6a27bc54f072@deltatee.com> Date: Sat, 11 Feb 2017 11:43:33 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 50.66.97.235 X-SA-Exim-Rcpt-To: linux-nvdimm@lists.01.org, linux-kernel@vger.kernel.org, jack@suse.cz, arnd@arndb.de, vikas.cha.sajjan@hpe.com, paulmck@linux.vnet.ibm.com, jthumshirn@suse.de, gregkh@linuxfoundation.org, dan.j.williams@intel.com X-SA-Exim-Mail-From: logang@deltatee.com Subject: Re: [PATCH] device-dax: don't set kobj parent during cdev init X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/02/17 11:27 AM, Dan Williams wrote: > Why, when the lifetime of the cdev is already correct? Well, it's only correct if you use the kobj parent trick which Greg is arguing against. As someone reviewing/copying code that trick is unclear, undocumented and it looks rather odd messing with internal kobjects. Taking the explicit reference would be very clear, very standard and only net one additional line. > See commit ba09c01d2fa8 "dax: convert to the cdev api". I used to take > explicit references like you suggest, but cdev made it cleaner. I agree that, on the whole, that patch makes things a good deal cleaner. I'm not so sure that this one small aspect is an improvement. In any case, it's up to you. If you'd like I can certainly submit a v2 patch that adds the get/put. Thanks, Logan