------------------------------------------------------------
revno: 670
revision-id:[EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Andrew Tridgell <[EMAIL PROTECTED]>
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)

Reply via email to