vn_rdwr() didn't properly advance the file position

This would cause problems when using 'zfs send' with a file as the
target (rather than a pipe or a socket as is usually the case) as
for each write the destination offset in the file would be 0.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes ZFS issue #391
This commit is contained in:
Gunnar Beutner 2011-10-12 12:49:18 +02:00 committed by Brian Behlendorf
parent a49bc99689
commit f3989ed322

View File

@ -247,6 +247,7 @@ vn_rdwr(uio_rw_t uio, vnode_t *vp, void *addr, ssize_t len, offset_t off,
rc = vfs_read(fp, addr, len, &offset);
set_fs(saved_fs);
fp->f_pos = offset;
if (rc < 0)
SRETURN(-rc);