[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/3] buffer writes to sysfs
On Mon, Jan 24, 2005 at 10:37:00AM -0800, Mitch Williams wrote:
> On Sat, 22 Jan 2005, Greg KH wrote:
> > On Fri, Jan 21, 2005 at 02:52:29PM -0800, Mitch Williams wrote:
> > > This patch buffers writes to sysfs files and flushes them to the
> > kobject
> > > owner when the file is closed.
> > Why? This breaks the way things work today, right?
> > What is this patch trying to fix?
> To be honest, I'm a bit ambivalent about this patch. I wrote this code in
> response to a bug filed by our test lab. If you write a bunch (e.g. > 1K)
> of data to a sysfs file, the c library splits it up into multiple writes
> of 1K or less. Because the kobject store method doesn't support offsets,
> and because the call to copy_from_user doesn't honor offsets, you end up
> with multiple calls to the store method, with incorrect results and no
> error code.
Who is trying to send > 1K to a sysfs file? Remember, sysfs files are
for 1 value only. If you consider > 1K a "single value" please point me
to that part of the kernel that does that.
> To the typical user, there's really no difference in behavior, unless you
> are writing a ton of data into the file. Of course, there's the obvious
> question of why you'd want to do so...
Exactly, you should not be doing that anyway. So, because of that, I
really don't want/like this patch.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/