mirror of
https://github.com/samba-team/samba.git
synced 2024-12-24 21:34:56 +03:00
vfs_ceph: fix strict_allocate_ftruncate()
The vfs_ceph "strict allocate = yes" ftruncate wrapper may attempt *local* filesystem ftruncate(). Fix this. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13807 Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
This commit is contained in:
parent
5a7e728081
commit
70329c36ed
@ -1058,8 +1058,10 @@ static int strict_allocate_ftruncate(struct vfs_handle_struct *handle, files_str
|
||||
return 0;
|
||||
|
||||
/* Shrink - just ftruncate. */
|
||||
if (pst->st_ex_size > len)
|
||||
return ftruncate(fsp->fh->fd, len);
|
||||
if (pst->st_ex_size > len) {
|
||||
ret = ceph_ftruncate(handle->data, fsp->fh->fd, len);
|
||||
WRAP_RETURN(ret);
|
||||
}
|
||||
|
||||
space_to_write = len - pst->st_ex_size;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user