From 532ff3a5b9580f75ee770fc7da7ba7fc43b5a91f Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 2 May 2018 16:47:22 -0700 Subject: [PATCH] s3: VFS: ceph: Replace the lseek/write ftruncate extend with pwrite. Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- source3/modules/vfs_ceph.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) 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: -- 2.47.2