All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Oleg Drokin <green@linuxhacker.ru>
Cc: devel@driverdev.osuosl.org,
	Andreas Dilger <andreas.dilger@intel.com>,
	James Simmons <jsimmons@infradead.org>,
	Al Viro <viro@ZenIV.linux.org.uk>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Lustre Development List <lustre-devel@lists.lustre.org>
Subject: Re: [PATCH/RFC] staging/lustre: Rework class_process_proc_param
Date: Sat, 18 Mar 2017 18:34:43 +0800	[thread overview]
Message-ID: <20170318103443.GA21943@kroah.com> (raw)
In-Reply-To: <20170318062408.3207381-1-green@linuxhacker.ru>

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

WARNING: multiple messages have this Message-ID (diff)
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Oleg Drokin <green@linuxhacker.ru>
Cc: devel@driverdev.osuosl.org,
	Andreas Dilger <andreas.dilger@intel.com>,
	James Simmons <jsimmons@infradead.org>,
	Al Viro <viro@ZenIV.linux.org.uk>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Lustre Development List <lustre-devel@lists.lustre.org>
Subject: [lustre-devel] [PATCH/RFC] staging/lustre: Rework class_process_proc_param
Date: Sat, 18 Mar 2017 18:34:43 +0800	[thread overview]
Message-ID: <20170318103443.GA21943@kroah.com> (raw)
In-Reply-To: <20170318062408.3207381-1-green@linuxhacker.ru>

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

  reply	other threads:[~2017-03-18 10:35 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-18  6:24 [PATCH/RFC] staging/lustre: Rework class_process_proc_param Oleg Drokin
2017-03-18  6:24 ` [lustre-devel] " Oleg Drokin
2017-03-18 10:34 ` Greg Kroah-Hartman [this message]
2017-03-18 10:34   ` Greg Kroah-Hartman
2017-03-18 15:17   ` Oleg Drokin
2017-03-18 15:17     ` [lustre-devel] " Oleg Drokin
2017-03-19  4:29     ` Greg Kroah-Hartman
2017-03-19  4:29       ` [lustre-devel] " Greg Kroah-Hartman
2017-03-19  4:41       ` Oleg Drokin
2017-03-19  4:41         ` [lustre-devel] " Oleg Drokin
2017-03-19  4:47         ` Greg Kroah-Hartman
2017-03-19  4:47           ` [lustre-devel] " Greg Kroah-Hartman
2017-03-19  4:41 ` Greg Kroah-Hartman
2017-03-19  4:41   ` [lustre-devel] " Greg Kroah-Hartman
2017-03-19  4:50   ` Oleg Drokin
2017-03-19  4:50     ` [lustre-devel] " Oleg Drokin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170318103443.GA21943@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=andreas.dilger@intel.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=green@linuxhacker.ru \
    --cc=jsimmons@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lustre-devel@lists.lustre.org \
    --cc=viro@ZenIV.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.