The Samba-Bugzilla – Attachment 9099 Details for
Bug 10064
Linux kernel oplock breaks can miss signals.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
git-am fix for 3.6.x.
look1 (text/plain), 2.89 KB, created by
Jeremy Allison
on 2013-08-01 20:14:53 UTC
(
hide
)
Description:
git-am fix for 3.6.x.
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2013-08-01 20:14:53 UTC
Size:
2.89 KB
patch
obsolete
>From 0c490d8eda2ed455c5df18991aff8ce72115c810 Mon Sep 17 00:00:00 2001 >From: Jeremy Allison <jra@samba.org> >Date: Wed, 31 Jul 2013 16:32:20 -0700 >Subject: [PATCH 1/2] Wrap setting leases in become_root()/unbecome_root() to > ensure correct delivery of signals. > >Remove workaround for Linux kernel bug https://bugzilla.kernel.org/show_bug.cgi?id=43336 >as we don't need to set capabilities when we're already root. > >Signed-off-by: Jeremy Allison <jra@samba.org> >Reviewed-by: Simo Sorce <idra@samba.org> >--- > source3/smbd/oplock_linux.c | 33 ++++++++++++++++++++------------- > 1 file changed, 20 insertions(+), 13 deletions(-) > >diff --git a/source3/smbd/oplock_linux.c b/source3/smbd/oplock_linux.c >index 02bd32a..82523f2 100644 >--- a/source3/smbd/oplock_linux.c >+++ b/source3/smbd/oplock_linux.c >@@ -75,26 +75,33 @@ int linux_set_lease_sighandler(int fd) > int linux_setlease(int fd, int leasetype) > { > int ret; >+ int saved_errno; >+ >+ /* >+ * Ensure the lease owner is root to allow >+ * correct delivery of lease-break signals. >+ */ >+ >+ become_root(); > > /* First set the signal handler. */ > if (linux_set_lease_sighandler(fd) == -1) { >- return -1; >+ saved_errno = errno; >+ ret = -1; >+ goto out; > } > 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); >+ if (ret == -1) { >+ saved_errno = errno; > } > >+ out: >+ >+ unbecome_root(); >+ >+ if (ret == -1) { >+ errno = saved_errno; >+ } > return ret; > } > >-- >1.8.3 > > >From cbebb17af888c1f1ca4f55a1b7cab58360fb7d66 Mon Sep 17 00:00:00 2001 >From: Ralph Wuerthner <ralphw@de.ibm.com> >Date: Wed, 31 Jul 2013 16:33:48 -0700 >Subject: [PATCH 2/2] Ensure gpfs kernel leases are wrapped in a > become_root()/unbecome_root() pair. > >Ensures correct lease owner for signal delivery. > >Signed-off-by: Ralph Wuerthner <ralphw@de.ibm.com> >Reviewed-by: Jeremy Allison <jra@samba.org> >Reviewed-by: Simo Sorce <idra@samba.org> > >Autobuild-User(master): Jeremy Allison <jra@samba.org> >Autobuild-Date(master): Thu Aug 1 03:57:11 CEST 2013 on sn-devel-104 >--- > source3/modules/vfs_gpfs.c | 6 ++++++ > 1 file changed, 6 insertions(+) > >diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c >index 7bc2832..4aad679 100644 >--- a/source3/modules/vfs_gpfs.c >+++ b/source3/modules/vfs_gpfs.c >@@ -97,7 +97,13 @@ static int vfs_gpfs_setlease(vfs_handle_struct *handle, files_struct *fsp, > return -1; > > if (config->leases) { >+ /* >+ * Ensure the lease owner is root to allow >+ * correct delivery of lease-break signals. >+ */ >+ become_root(); > ret = set_gpfs_lease(fsp->fh->fd,leasetype); >+ unbecome_root(); > } > > if (ret < 0) { >-- >1.8.3 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
ambi
:
review+
Actions:
View
Attachments on
bug 10064
:
9098
| 9099