From 0a5f4f523fe3dcb90033ee53c838ad6030f608b4 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 20 Dec 2010 17:58:33 -0800 Subject: Keep track of the sparse status of an open file handle. Allows bypass of strict allocation on sparse files. Files opened as POSIX opens are always sparse. Autobuild-User: Jeremy Allison Autobuild-Date: Tue Dec 21 04:12:22 CET 2010 on sn-devel-104 --- source3/smbd/fileio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source3/smbd/fileio.c') diff --git a/source3/smbd/fileio.c b/source3/smbd/fileio.c index aec6554436..da40013bc5 100644 --- a/source3/smbd/fileio.c +++ b/source3/smbd/fileio.c @@ -128,7 +128,8 @@ static ssize_t real_write_file(struct smb_request *req, ret = vfs_write_data(req, fsp, data, n); } else { fsp->fh->pos = pos; - if (pos && lp_strict_allocate(SNUM(fsp->conn))) { + if (pos && lp_strict_allocate(SNUM(fsp->conn) && + !fsp->is_sparse)) { if (vfs_fill_sparse(fsp, pos) == -1) { return -1; } -- cgit