]> git.neil.brown.name Git - history.git/commit
[PATCH] Fix readv/writev return value
authorAndrew Morton <akpm@digeo.com>
Sun, 10 Nov 2002 10:01:28 +0000 (02:01 -0800)
committerDavid S. Miller <davem@nuts.ninka.net>
Sun, 10 Nov 2002 10:01:28 +0000 (02:01 -0800)
commit33f9ef1c778bfd16bc2f7ac0c1470c3984961660
tree2fedaa38e490c3ff4d6c4e5575b0a6e9e032db2f
parente300f70b13ec4c9bafa638f40da81676966efacb
[PATCH] Fix readv/writev return value

A patch from Janet Morgan <janetmor@us.ibm.com>

If you feed an iovec with a bad address not at the zeroeth segment into
readv or writev, it returns the wrong value.

iovec 1:  base is 8050b20 len is 64
iovec 2:  base is ffffffff len is 64
iovec 3:  base is 8050ba0 len is 64

The writev should return 64 bytes but is returning 128

This is because we've added the new segment's length into `count'
before running access_ok().

The patch changes it to fix that up on the slow path, if access_ok() fails.
mm/filemap.c