]> git.proxmox.com Git - mirror_spl.git/commitdiff
vn_rdwr() didn't properly advance the file position
authorGunnar Beutner <gunnar@beutner.name>
Wed, 12 Oct 2011 10:49:18 +0000 (12:49 +0200)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 18 Oct 2011 23:51:35 +0000 (16:51 -0700)
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

module/spl/spl-vnode.c

index 1b5cc5a0824413cfb56a54bc81fa01586b1670d2..354e8798b9709b5a1ac80d053e0afc7a1fdaff71 100644 (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);