Re: [PATCH 7/10] 9p: sysfs support for in-kenel servers

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Greg KH
Date: Friday, November 2, 2007 - 8:48 pm

On Fri, Nov 02, 2007 at 11:05:27AM -0600, Latchesar Ionkov wrote:

Traditionally sysfs has not been used for "configuration" stuff like
this, as that is what configfs is for.

Also, a sysfs file that causes an action to happen just by reading the
file is not a safe thing to have.  Lots of scripts have been known to
just walk the whole sysfs tree and open and read everything they can for
no real good reason.  So you should seriously reconsider this kind of
interaction.



What's wrong with the __ATTR macro?  Using a "raw" struct attribute
seems a bit odd here.


Same here.


Yes, otherwise you just leaked memory :)


{sigh}

Yes, the kernel complains if you do not have a release function for your
kobject, but did you think that just providing an empty function is
somehow the proper thing to do here?

It wants you to do something in the release function, like free the
memory of the object.  Not just provide empty functions to try to shut
it up...

Please fix this.


Again, creating stuff in a show function is not a good idea.


Well, no, not if your release function frees the memory, otherwise it is
still present the way the code is written today...

But watch out, you are going here if kobject_add() fails, in which case,
kobject_unregister makes no sense as the kobject was never properly
added.


Again with the empty release :(



This macro is now gone away in the next -mm release :)

thanks,

greg k-h
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 7/10] 9p: sysfs support for in-kenel servers, Latchesar Ionkov, (Fri Nov 2, 10:05 am)
Re: [PATCH 7/10] 9p: sysfs support for in-kenel servers, Greg KH, (Fri Nov 2, 8:48 pm)
Re: [PATCH 7/10] 9p: sysfs support for in-kenel servers, Peter Zijlstra, (Sat Nov 3, 3:33 am)
Re: [PATCH 7/10] 9p: sysfs support for in-kenel servers, Christoph Lameter, (Sat Nov 3, 11:22 am)