From: Jeremy Allison Date: Wed, 2 May 2018 23:47:22 +0000 (-0700) Subject: s3: VFS: ceph: Replace the lseek/write ftruncate extend with pwrite. X-Git-Tag: ldb-1.4.0~407 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=532ff3a5b958;p=thirdparty%2Fsamba.git s3: VFS: ceph: Replace the lseek/write ftruncate extend with pwrite. Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- diff --git a/source3/modules/vfs_ceph.c b/source3/modules/vfs_ceph.c index 2f50aa67c57..cfb887d4e3c 100644 --- a/source3/modules/vfs_ceph.c +++ b/source3/modules/vfs_ceph.c @@ -1113,15 +1113,10 @@ static int cephwrap_ftruncate(struct vfs_handle_struct *handle, files_struct *fs goto done; } - if (SMB_VFS_LSEEK(fsp, len-1, SEEK_SET) != len -1) - goto done; - - if (SMB_VFS_WRITE(fsp, &c, 1)!=1) + if (SMB_VFS_PWRITE(fsp, &c, 1, len-1)!=1) { goto done; + } - /* Seek to where we were */ - if (SMB_VFS_LSEEK(fsp, currpos, SEEK_SET) != currpos) - goto done; result = 0; done: