From 5e450f5ba9250608f6b85bbf4fc746879d56ccc1 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 5 Sep 2013 10:33:21 +0000 Subject: smbd: Fix breaking level2 on allocate This needs doing even if we don't have strct allocate set. The client should not know that we lied. Fixes smb2.oplock.batch12. Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- source3/smbd/vfs.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'source3/smbd/vfs.c') diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c index 49609d01794..ca6500cf8cc 100644 --- a/source3/smbd/vfs.c +++ b/source3/smbd/vfs.c @@ -561,16 +561,17 @@ int vfs_allocate_file_space(files_struct *fsp, uint64_t len) return ret; } - if (!lp_strict_allocate(SNUM(fsp->conn))) - return 0; - /* Grow - we need to test if we have enough space. */ contend_level2_oplocks_begin(fsp, LEVEL2_CONTEND_ALLOC_GROW); - /* See if we have a syscall that will allocate beyond end-of-file - without changing EOF. */ - ret = SMB_VFS_FALLOCATE(fsp, VFS_FALLOCATE_KEEP_SIZE, 0, len); + if (lp_strict_allocate(SNUM(fsp->conn))) { + /* See if we have a syscall that will allocate beyond + end-of-file without changing EOF. */ + ret = SMB_VFS_FALLOCATE(fsp, VFS_FALLOCATE_KEEP_SIZE, 0, len); + } else { + ret = 0; + } contend_level2_oplocks_end(fsp, LEVEL2_CONTEND_ALLOC_GROW); -- cgit