lkml.org 
[lkml]   [2013]   [Dec]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v2 2/2] tun: update file current position
From
From: Zhi Yong Wu <zwu.kernel@gmail.com>
Date: Fri, 6 Dec 2013 17:08:50 +0800

> From: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
>
> Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>

Also applied and queued up for -stable, thanks.

I noticed in these two cases that that min_t() adjustment of 'ret'
seems strange. I can't understand why it's needed.

If, for example, tun_do_read() really did read more than 'len'
bytes:

1) That would write past the end of the buffer.

2) Writing a different value to the ->ki_pos would mean
that ->ki_pos is now inaccurate.

Unless someone can explain why the min_t() is needed, we should remove
it.


\
 
 \ /
  Last update: 2013-12-06 19:01    [W:0.067 / U:0.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site