Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751512AbdCRKfA (ORCPT ); Sat, 18 Mar 2017 06:35:00 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:59370 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751409AbdCRKe7 (ORCPT ); Sat, 18 Mar 2017 06:34:59 -0400 Date: Sat, 18 Mar 2017 18:34:43 +0800 From: Greg Kroah-Hartman To: Oleg Drokin Cc: devel@driverdev.osuosl.org, Andreas Dilger , James Simmons , Al Viro , Linux Kernel Mailing List , Lustre Development List Subject: Re: [PATCH/RFC] staging/lustre: Rework class_process_proc_param Message-ID: <20170318103443.GA21943@kroah.com> References: <20170318062408.3207381-1-green@linuxhacker.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170318062408.3207381-1-green@linuxhacker.ru> User-Agent: Mutt/1.8.0 (2017-02-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2004 Lines: 44 On Sat, Mar 18, 2017 at 02:24:08AM -0400, Oleg Drokin wrote: > Ever since sysfs migration, class_process_proc_param stopped working > correctly as all the useful params were no longer present as lvars. > Replace all the nasty fake proc writes with hopefully less nasty > kobject attribute search and then update the attributes as needed. > > Signed-off-by: Oleg Drokin > Reported-by: Al Viro > --- > Al has quite rightfully complained in the past that class_process_proc_param > is a terrible piece of code and needs to go. > This patch is an attempt at improving it somewhat and in process drop > all the user/kernel address space games we needed to play to make it work > in the past (and which I suspect attracted Al's attention in the first place). > > Now I wonder if iterating kobject attributes like that would be ok with > you Greg, or do you think there is a better way? > class_find_write_attr could be turned into something generic since it's > certainly convenient to reuse same table of name-write_method pairs, > but I did some cursory research and nobody else seems to need anything > of the sort in-tree. > > I know ll_process_config is still awful and I will likely just > replace the current hack with kset_find_obj, but I just wanted to make > sure this new approach would be ok before spending too much time on it. I'm not quite sure what exactly you are even trying to do here. What is this interface? Who calls it, and how? What does it want to do? You can look up attributes for a kobject easily in the show/store functions (and some drivers just have a generic one and then you look at the string to see which attribute you are wanting to reference.) But you seem to be working backwards here, why do you have to look up a kobject? What is wrong with the "normal" way to interact with kobject attributes from sysfs? What does your "process proc" function do? Where does it get called from? totally confused, greg k-h