lkml.org 
[lkml]   [2009]   [Aug]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] Fix proc_file_write missing ppos update
Andrew Morton <akpm@linux-foundation.org> writes:

> On Fri, 07 Aug 2009 23:43:07 +0200
> Stefani Seibold <stefani@seibold.net> wrote:
>

>> So what is your suggestion? Should we drop this patch or should we
>> analyze the users and fix it?
>
> Well.
>
> We could review all implementations of ->write_proc. There only seem
> to be twenty or so.
>
> If any of them will have their behaviour altered by this patch then
> let's look at those on a case-by-case basis and decide whether making
> this change will have an acceptable risk.
>
> If we _do_ find one for which we simply cannot make this behavioural
> change then.. ugh. We could perhaps add a new `bool
> proc_dir_entry.implement_old_broken_behaviour' and set that flag for
> the offending driver(s) and test it within proc_write_file().
>
> Or we could do
>
> if (pde->write_proc_new) {
> rv = pde->write_proc_new(file, buffer, count, pde->data);
> *ppos += rv;
> } else {
> rv = pde->write_proc(file, buffer, count, pde->data);
> }
>
> which is really the same thing and isn't obviously better ;)
>
>> My opinion is to fix it, because it is wrong and it limits the usage of
>> the proc_write operation. Many embedded developers like me count on proc
>> support, because it is much simpler to use than the seqfile thing.

The simple and portable answer is to implement your own file_operations.

It is unlikely that implementing a new totally unstructured proc file is
a good idea.

I'm not quite up to speed on write_proc but I believe we have been spraying
read_proc and write_proc because of problems with the interface.

Eric


\
 
 \ /
  Last update: 2009-08-08 09:01    [W:0.240 / U:3.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site