From 8a1756006a1abf8ceb22fff889c94b3d28d19c20 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 17 May 2005 01:04:51 +0000 Subject: r6841: Attempt to fix buf #2681. With "strict allocate = yes" we now zero fill when a file is extended. Should catch disk full errors on write from MS-Office. Jeremy. (This used to be commit 858824f37be443320487a8e28ec8fa172cdf5a18) --- source3/smbd/fileio.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source3/smbd/fileio.c') diff --git a/source3/smbd/fileio.c b/source3/smbd/fileio.c index dbf1e5a789..977988fde4 100644 --- a/source3/smbd/fileio.c +++ b/source3/smbd/fileio.c @@ -125,6 +125,11 @@ static ssize_t real_write_file(files_struct *fsp,char *data,SMB_OFF_T pos, size_ ret = vfs_write_data(fsp, data, n); } else { fsp->pos = pos; + if (pos && lp_strict_allocate(SNUM(fsp->conn))) { + if (vfs_fill_sparse(fsp, pos) == -1) { + return -1; + } + } ret = vfs_pwrite_data(fsp, data, n, pos); } -- cgit