Rev 670: fix a problem with incorrect capabilities and gpfs oplocks in http://samba.org/~tridge/3_0-ctdb

tridge at samba.org tridge at samba.org
Thu Nov 22 01:57:31 GMT 2007


------------------------------------------------------------
revno: 670
revision-id:tridge at samba.org-20071122015657-pkleqi180qha74eh
parent: tridge at samba.org-20071118203656-hpnis9680nqjqmc0
committer: Andrew Tridgell <tridge at samba.org>
branch nick: s3-ctdb-tridge
timestamp: Thu 2007-11-22 12:56:57 +1100
message:
  fix a problem with incorrect capabilities and gpfs oplocks
modified:
  source/modules/gpfs.c          gpfs.c-20070210173807-1wjifrbwaz6xnmgl-647
  source/smbd/oplock_linux.c     oplock_linux.c-20070210173807-1wjifrbwaz6xnmgl-1028
=== modified file 'source/modules/gpfs.c'
--- a/source/modules/gpfs.c	2007-10-22 00:23:38 +0000
+++ b/source/modules/gpfs.c	2007-11-22 01:56:57 +0000
@@ -105,6 +105,8 @@
 	if (leasetype == F_WRLCK) {
 		gpfs_type = GPFS_LEASE_WRITE;
 	}
+
+	linux_set_lease_capability();
 	return gpfs_set_lease_fn(fd, gpfs_type);
 }
 

=== modified file 'source/smbd/oplock_linux.c'
--- a/source/smbd/oplock_linux.c	2007-05-21 10:59:16 +0000
+++ b/source/smbd/oplock_linux.c	2007-11-22 01:56:57 +0000
@@ -94,15 +94,25 @@
 		return;
 	}
 
-	data.effective |= (1<<capability);
+	if (0 == (data.effective & (1<<capability))) {
+		data.effective |= (1<<capability);
 
-	if (capset(&header, &data) == -1) {
-		DEBUG(3,("Unable to set %d capability (%s)\n", 
-			 capability, strerror(errno)));
+		if (capset(&header, &data) == -1) {
+			DEBUG(3,("Unable to set %d capability (%s)\n", 
+				 capability, strerror(errno)));
+		}
 	}
 }
 
 /*
+  public function to get linux lease capability. Needed by some VFS modules (eg. gpfs.c)
+ */
+void linux_set_lease_capability(void)
+{
+	set_capability(CAP_LEASE);
+}
+
+/*
  Call to set the kernel lease signal handler
 */
 int linux_set_lease_sighandler(int fd)



More information about the samba-cvs mailing list