Pavel Machek <[EMAIL PROTECTED]> wrote:
>
> > One more piece of information.  This is the one that loops:
>  > 
>  > echo 30 > /sys/class/firmware/timeout
> 
>  Try echo -n ...

Or revert gregkh-driver-sysfs-strip_leading_trailing_whitespace.patch. 
Obviously if you write 30\n and the write returns 2 then the shell will
then try to write the \n.  That returns zero and the shell tries again, ad
infinitum.

Rant.  It took me two full days to weed out and fix all the crap people
sent me to get -mm1 into a state where it vaguely compiled and booted.  And
it's untested nonsense like this which wrecks the whole effort for many
testers.

I suppose this is as good as anything....


From: Andrew Morton <[EMAIL PROTECTED]>

Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 fs/sysfs/file.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff -puN 
fs/sysfs/file.c~gregkh-driver-sysfs-strip_leading_trailing_whitespace-fix 
fs/sysfs/file.c
--- 
devel/fs/sysfs/file.c~gregkh-driver-sysfs-strip_leading_trailing_whitespace-fix 
    2005-09-02 04:01:40.000000000 -0700
+++ devel-akpm/fs/sysfs/file.c  2005-09-02 04:05:02.000000000 -0700
@@ -202,13 +202,14 @@ fill_write_buffer(struct sysfs_buffer * 
  *     passing the buffer that we acquired in fill_write_buffer().
  */
 
-static int 
-flush_write_buffer(struct dentry * dentry, struct sysfs_buffer * buffer, 
size_t count)
+static int flush_write_buffer(struct dentry *dentry,
+                       struct sysfs_buffer *buffer, size_t count_in)
 {
        struct attribute * attr = to_attr(dentry);
        struct kobject * kobj = to_kobj(dentry->d_parent);
        struct sysfs_ops * ops = buffer->ops;
        char *x;
+       size_t count = count_in;
 
        /* locate trailing white space */
        while ((count > 0) && isspace(buffer->page[count - 1]))
@@ -224,7 +225,8 @@ flush_write_buffer(struct dentry * dentr
        /* terminate the string */
        x[count] = '\0';
 
-       return ops->store(kobj, attr, x, count);
+       ops->store(kobj, attr, x, count);
+       return count_in;
 }
 
 
_

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

Reply via email to