lkml.org 
[lkml]   [2005]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/3] disallow seeks and appends on sysfs files
On Mon, Jan 24, 2005 at 10:16:37AM -0800, Mitch Williams wrote:
>
>
> On Sat, 22 Jan 2005, Greg KH wrote:
>
> >
> > On Fri, Jan 21, 2005 at 02:49:39PM -0800, Mitch Williams wrote:
> > > This patch causes sysfs to return errors if the caller attempts to
> > append
> > > to or seek on a sysfs file.
> >
> > And what happens to it today if you do either of these?
> >
> > Also, isn't this two different things?
> >
> Appending and seeking are obviously two different operations, but the
> result is the same to the sysfs file system. Because the store method
> doesn't have an offset argument, it must assume that all writes are based
> from the beginning of the buffer.
>
> So if your sysfs file contains "123" and you do
> echo "45" >> mysysfsfile
> instead of the expected "12345", you end up with "45" in the file with no
> errors. Opening the file, seeking, and writing gives the same type of
> behavior, with no errors.

Ick, yeah, but users shouldn't be doing that :)

Anyway, ok, I'll accept this kind of patch, to give errors for that.

> However, if you want two even simpler patches, I'm willing to comply. Of
> the three patches I sent, this is the most important to me.

Yes, could you split it up?

> > Please, no {} for one line if statements. Like the one above it :)
>
> I'll be glad to fix this and resubmit. I prefer to not have braces
> either, but I've seen a bunch of places in the kernel where people do it,
> so I really wasn't sure which was right. It's not really called out in
> the coding style doc either.

Yes, please fix this and resubmit it.

thanks,

greg k-h
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:09    [W:0.070 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site