mirror of https://gitee.com/openkylin/linux.git
tun: update file current position
Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
e6ebc7f16c
commit
d0b7da8afa
|
@ -1356,6 +1356,8 @@ static ssize_t tun_chr_aio_read(struct kiocb *iocb, const struct iovec *iv,
|
|||
ret = tun_do_read(tun, tfile, iocb, iv, len,
|
||||
file->f_flags & O_NONBLOCK);
|
||||
ret = min_t(ssize_t, ret, len);
|
||||
if (ret > 0)
|
||||
iocb->ki_pos = ret;
|
||||
out:
|
||||
tun_put(tun);
|
||||
return ret;
|
||||
|
|
Loading…
Reference in New Issue