From: Greg KH <greg@kroah.com>
To: Mitch Williams <mitch.a.williams@intel.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] disallow seeks and appends on sysfs files
Date: Mon, 24 Jan 2005 13:40:14 -0800 [thread overview]
Message-ID: <20050124214014.GF18933@kroah.com> (raw)
In-Reply-To: <Pine.CYG.4.58.0501241005070.3748@mawilli1-desk2.amr.corp.intel.com>
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
prev parent reply other threads:[~2005-01-24 21:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-21 22:49 [PATCH 1/3] disallow seeks and appends on sysfs files Mitch Williams
2005-01-22 8:05 ` Greg KH
2005-01-24 18:16 ` Mitch Williams
2005-01-24 21:40 ` Greg KH [this message]
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=20050124214014.GF18933@kroah.com \
--to=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mitch.a.williams@intel.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox