summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2013-09-05 10:33:21 +0000
committerJeremy Allison <jra@samba.org>2013-09-05 13:42:05 -0700
commit5e450f5ba9250608f6b85bbf4fc746879d56ccc1 (patch)
tree0a12d393e26ae85e7a6371d1d0ffe09dc3324fe7
parentd3c689fc5c80431b7e72150f72465b3d255a6f02 (diff)
downloadsamba-5e450f5ba9250608f6b85bbf4fc746879d56ccc1.tar.gz
samba-5e450f5ba9250608f6b85bbf4fc746879d56ccc1.tar.bz2
samba-5e450f5ba9250608f6b85bbf4fc746879d56ccc1.zip
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 <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
-rw-r--r--selftest/knownfail1
-rw-r--r--source3/smbd/vfs.c13
2 files changed, 7 insertions, 7 deletions
diff --git a/selftest/knownfail b/selftest/knownfail
index 6fe7ce5c01..8b89f00f60 100644
--- a/selftest/knownfail
+++ b/selftest/knownfail
@@ -203,7 +203,6 @@
^samba3.smb2.lease.oplock
^samba3.smb2.lease.multibreak
^samba3.smb2.lease.v2_request
-^samba3.smb2.oplock.batch12
^samba3.smb2.oplock.batch20
^samba3.smb2.oplock.stream1
^samba3.smb2.streams.rename
diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c
index 49609d0179..ca6500cf8c 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);