summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorChristian Ambach <ambi@samba.org>2012-08-07 18:42:39 +0200
committerChristian Ambach <ambi@samba.org>2012-08-16 18:05:29 +0200
commit6e3901194bbd74e2f5e7a0f0928c52da92e729c1 (patch)
tree78ce6a2bc0f46e5113de397f15fdf504c7352e8d /source3
parenta8b583089bfa2d4f7f9f4d0aba0f0640ef1ad959 (diff)
downloadsamba-6e3901194bbd74e2f5e7a0f0928c52da92e729c1.tar.gz
samba-6e3901194bbd74e2f5e7a0f0928c52da92e729c1.tar.bz2
samba-6e3901194bbd74e2f5e7a0f0928c52da92e729c1.zip
s3:vfs_gpfs: make sure parameters are set correctly for leases
gpfs:leases requires kernel oplocks = yes and level2 oplocks = no to work properly make sure those are set correctly for a share
Diffstat (limited to 'source3')
-rw-r--r--source3/modules/vfs_gpfs.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c
index 874d00d048..a988c09164 100644
--- a/source3/modules/vfs_gpfs.c
+++ b/source3/modules/vfs_gpfs.c
@@ -1505,6 +1505,31 @@ static int vfs_gpfs_connect(struct vfs_handle_struct *handle,
NULL, struct gpfs_config_data,
return -1);
+ if (config->leases) {
+ /*
+ * GPFS lease code is based on kernel oplock code
+ * so make sure it is turned on
+ */
+ if (!lp_kernel_oplocks(SNUM(handle->conn))) {
+ DEBUG(5, ("Enabling kernel oplocks for "
+ "gpfs:leases to work\n"));
+ lp_do_parameter(SNUM(handle->conn), "kernel oplocks",
+ "true");
+ }
+
+ /*
+ * as the kernel does not properly support Level II oplocks
+ * and GPFS leases code is based on kernel infrastructure, we
+ * need to turn off Level II oplocks if gpfs:leases is enabled
+ */
+ if (lp_level2_oplocks(SNUM(handle->conn))) {
+ DEBUG(5, ("gpfs:leases are enabled, disabling "
+ "Level II oplocks\n"));
+ lp_do_parameter(SNUM(handle->conn), "level2 oplocks",
+ "false");
+ }
+ }
+
return 0;
}