From 6e3901194bbd74e2f5e7a0f0928c52da92e729c1 Mon Sep 17 00:00:00 2001 From: Christian Ambach Date: Tue, 7 Aug 2012 18:42:39 +0200 Subject: 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 --- source3/modules/vfs_gpfs.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'source3/modules') 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; } -- cgit