From: Christian Ambach Date: Tue, 7 Aug 2012 16:42:39 +0000 (+0200) Subject: s3:vfs_gpfs: make sure parameters are set correctly for leases X-Git-Tag: tevent-0.9.17~10 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6e3901194bbd74e2f5e7a0f0928c52da92e729c1;p=thirdparty%2Fsamba.git 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 --- diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c index 874d00d048c..a988c091641 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; }