Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1603761

Re: [PATCH/RFC] staging/lustre: Rework class_process_proc_param

From Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Newsgroups linux.kernel
Subject Re: [PATCH/RFC] staging/lustre: Rework class_process_proc_param
Date 2017-03-18 11:40 +0100
Message-ID <tmjWa-4U7-13@gated-at.bofh.it> (permalink)
References <tmj9L-4hL-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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 <green@linuxhacker.ru>
> Reported-by: Al Viro <viro@ZenIV.linux.org.uk>
> ---
> 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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH/RFC] staging/lustre: Rework class_process_proc_param Oleg Drokin <green@linuxhacker.ru> - 2017-03-18 10:50 +0100
  Re: [PATCH/RFC] staging/lustre: Rework class_process_proc_param Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-18 11:40 +0100
    Re: [PATCH/RFC] staging/lustre: Rework class_process_proc_param Oleg Drokin <green@linuxhacker.ru> - 2017-03-18 16:50 +0100
      Re: [PATCH/RFC] staging/lustre: Rework class_process_proc_param Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-19 05:40 +0100
        Re: [PATCH/RFC] staging/lustre: Rework class_process_proc_param Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-19 05:50 +0100
        Re: [PATCH/RFC] staging/lustre: Rework class_process_proc_param Oleg Drokin <green@linuxhacker.ru> - 2017-03-19 05:50 +0100
  Re: [PATCH/RFC] staging/lustre: Rework class_process_proc_param Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-19 05:50 +0100
    Re: [PATCH/RFC] staging/lustre: Rework class_process_proc_param Oleg Drokin <green@linuxhacker.ru> - 2017-03-19 06:00 +0100

csiph-web