summaryrefslogtreecommitdiff
path: root/source3/smbd/fileio.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2005-05-17 01:04:51 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:56:56 -0500
commit8a1756006a1abf8ceb22fff889c94b3d28d19c20 (patch)
tree93d2ae1d18347cb8a50598837c8149612296c561 /source3/smbd/fileio.c
parent6019df0858aa33e81167eeeade7f7264cd719cef (diff)
downloadsamba-8a1756006a1abf8ceb22fff889c94b3d28d19c20.tar.gz
samba-8a1756006a1abf8ceb22fff889c94b3d28d19c20.tar.bz2
samba-8a1756006a1abf8ceb22fff889c94b3d28d19c20.zip
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)
Diffstat (limited to 'source3/smbd/fileio.c')
-rw-r--r--source3/smbd/fileio.c5
1 files changed, 5 insertions, 0 deletions
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);
}