[SCM] Samba Shared Repository - branch v3-6-test updated
Karolin Seeger
kseeger at samba.org
Sat Jun 30 05:06:12 MDT 2012
The branch, v3-6-test has been updated
via 0e2fb6c Fix bug #8974 - Kernel oplocks are broken when uid(file) != uid(process).
from 1f19c2d s3: Correct documentation of case sensitive
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-6-test
- Log -----------------------------------------------------------------
commit 0e2fb6c69e971c7502fabe17fa71d1453dda18a6
Author: Jeremy Allison <jra at samba.org>
Date: Wed Jun 20 15:50:00 2012 -0700
Fix bug #8974 - Kernel oplocks are broken when uid(file) != uid(process).
Based on a fix from "Etienne Dechamps " <e-t172 at akegroup.org>
-----------------------------------------------------------------------
Summary of changes:
source3/modules/vfs_default.c | 5 -----
source3/smbd/oplock_linux.c | 13 +++++++++++++
2 files changed, 13 insertions(+), 5 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index 27e9b9b..2472ec1 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -1044,11 +1044,6 @@ static int vfswrap_linux_setlease(vfs_handle_struct *handle, files_struct *fsp,
START_PROFILE(syscall_linux_setlease);
#ifdef HAVE_KERNEL_OPLOCKS_LINUX
- /* first set the signal handler */
- if(linux_set_lease_sighandler(fsp->fh->fd) == -1) {
- return -1;
- }
-
result = linux_setlease(fsp->fh->fd, leasetype);
#else
errno = ENOSYS;
diff --git a/source3/smbd/oplock_linux.c b/source3/smbd/oplock_linux.c
index 4f243e2..02bd32a 100644
--- a/source3/smbd/oplock_linux.c
+++ b/source3/smbd/oplock_linux.c
@@ -76,9 +76,22 @@ int linux_setlease(int fd, int leasetype)
{
int ret;
+ /* First set the signal handler. */
+ if (linux_set_lease_sighandler(fd) == -1) {
+ return -1;
+ }
ret = fcntl(fd, F_SETLEASE, leasetype);
if (ret == -1 && errno == EACCES) {
set_effective_capability(LEASE_CAPABILITY);
+ /*
+ * Bug 8974 - work around Linux kernel bug
+ * https://bugzilla.kernel.org/show_bug.cgi?id=43336.
+ * "fcntl(F_SETLEASE) resets signal number when
+ * called multiple times"
+ */
+ if (linux_set_lease_sighandler(fd) == -1) {
+ return -1;
+ }
ret = fcntl(fd, F_SETLEASE, leasetype);
}
--
Samba Shared Repository
More information about the samba-cvs
mailing list