public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Stefani Seibold <stefani@seibold.net>
To: linux-kernel <linux-kernel@vger.kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Subject: [PATCH] Fix proc_file_write missing ppos update
Date: Fri, 07 Aug 2009 22:27:10 +0200	[thread overview]
Message-ID: <1249676830.27640.16.camel@wall-e> (raw)

The following fix a long standing issue in the proc_file_write function,
which doesn't update the ppos file position pointer.

This prevent the usage of multiple sequently writes on an opened proc
file, because it is impossible to distinguish these due the offset is
always 0.

Signed-off-by: Stefani Seibold <stefani@seibold.net>

 generic.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- linux-2.6.31-rc4.orig/fs/proc/generic.c	2009-08-07 22:05:57.000000000 +0200
+++ linux-2.6.30-rc4/fs/proc/generic.c	2009-08-07 22:06:22.000000000 +0200
@@ -219,9 +219,10 @@
 		pde->pde_users++;
 		spin_unlock(&pde->pde_unload_lock);
 
-		/* FIXME: does this routine need ppos?  probably... */
 		rv = pde->write_proc(file, buffer, count, pde->data);
 		pde_users_dec(pde);
+		if (rv > 0)
+			*ppos += rv;
 	}
 	return rv;
 }



             reply	other threads:[~2009-08-07 20:27 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-07 20:27 Stefani Seibold [this message]
2009-08-07 20:58 ` [PATCH] Fix proc_file_write missing ppos update Andrew Morton
2009-08-07 21:43   ` Stefani Seibold
2009-08-07 22:16     ` Andrew Morton
2009-08-08  6:59       ` Eric W. Biederman
2009-08-08  9:29         ` Stefani Seibold
  -- strict thread matches above, loose matches on Subject: below --
2009-08-29 16:38 Stefani Seibold
2009-08-29 23:16 ` Christoph Hellwig
2009-08-30  8:09   ` Alexey Dobriyan
2009-08-30 19:10     ` Stefani Seibold
2009-08-30 19:05   ` Stefani Seibold
2009-08-31  6:33     ` Alexey Dobriyan
2009-08-31 15:44       ` Arnd Bergmann
2009-08-31 17:19         ` Alexey Dobriyan
2009-08-31 17:21           ` Christoph Hellwig
2009-08-31 20:19           ` Arnd Bergmann
2009-09-12 15:28     ` Al Viro
2009-09-12 15:57       ` Stefani Seibold
2009-09-12 20:51         ` Eric W. Biederman

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=1249676830.27640.16.camel@wall-e \
    --to=stefani@seibold.net \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /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