lkml.org 
[lkml]   [2002]   [Mar]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: proc_file_read() hack?
From
Date
On Wed, 2002-03-27 at 13:26, Todd Inglett wrote:
> I guess I don't understand the conflict.

There are three cases:
0) start == 0
1) 0 < start < buffer
2) start >= buffer

These exhaust all the possible values that can be returned
in *start.

You propose to change the code so that there are three cases:
0) start == 0
1') 0 < start < PROC_BLOCK_SIZE
2'/3) start >= PROC_BLOCK_SIZE

However, we can't make the change you propose because it would
break functions that use case #1 with a *start value greater
than PROC_BLOCK_SIZE.

>... is there a chance that start >= PROC_BLOCK_SIZE (but start < page)
> in case #1?

Yes.

> If that is true I am wondering how it could possibly be correct
> since start will be used as a length which is greater than the
> size of the page.

start will be used as an offset, not as a length.

If you think the hack was a bad idea, I agree with you.
But we can't change it without auditing all the proc read
functions that use case #1.

--
Thomas Hood

-
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 13:25    [W:0.580 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site