Author: sthibault
Date: 2014-11-23 00:27:17 +0000 (Sun, 23 Nov 2014)
New Revision: 6334

Added:
   glibc-package/trunk/debian/patches/hurd-i386/tg-WRLCK-upgrade.diff
Modified:
   glibc-package/trunk/debian/changelog
   glibc-package/trunk/debian/patches/series
Log:
patches/hurd-i386/tg-WRLCK-upgrade.diff: New patch to fix atomicity of 
upgrading rd locks into wr locks.


Modified: glibc-package/trunk/debian/changelog
===================================================================
--- glibc-package/trunk/debian/changelog        2014-11-16 11:29:46 UTC (rev 
6333)
+++ glibc-package/trunk/debian/changelog        2014-11-23 00:27:17 UTC (rev 
6334)
@@ -3,11 +3,13 @@
   [ Samuel Thibault ]
   * patches/hurd-i386/libpthread_spin-lock.diff: New patch to fix spin-lock.h
     inclusion order.
+  * patches/hurd-i386/tg-WRLCK-upgrade.diff: New patch to fix atomicity of
+    upgrading rd locks into wr locks.
 
   [ Adam Conrad ]
   * debian/rules.d/tarball.mk: Fix update-from-upstream manual/* filter rule.
 
- [ Petr Salinger ]
+  [ Petr Salinger ]
   * kfreebsd/local-sysdeps.diff: update to revision 5688 (from glibc-bsd).
     Do not return EINTR from sigwait. Closes: #763705.
 

Added: glibc-package/trunk/debian/patches/hurd-i386/tg-WRLCK-upgrade.diff
===================================================================
--- glibc-package/trunk/debian/patches/hurd-i386/tg-WRLCK-upgrade.diff          
                (rev 0)
+++ glibc-package/trunk/debian/patches/hurd-i386/tg-WRLCK-upgrade.diff  
2014-11-23 00:27:17 UTC (rev 6334)
@@ -0,0 +1,30 @@
+From: Samuel Thibault <[email protected]>
+Subject: [PATCH] Make F_WRLCK potentially upgrade owned F_RDLCK
+
+lockf(LOCK_EX) would drop any existing shared lock before taking the exclusive
+lock. F_WRLCK needs an atomic upgrade, so use lockf(LOCK_SH|LOCK_EX) instead.
+
+Signed-off-by: Samuel Thibault <[email protected]>
+
+* sysdeps/mach/hurd/fcntl.c (__libc_fcntl): For F_WRLCK, set cmd to
+LOCK_SH|LOCK_EX instead of LOCK_SH.
+
+---
+ sysdeps/mach/hurd/fcntl.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sysdeps/mach/hurd/fcntl.c b/sysdeps/mach/hurd/fcntl.c
+index 70180fa..b827fec 100644
+--- a/sysdeps/mach/hurd/fcntl.c
++++ b/sysdeps/mach/hurd/fcntl.c
+@@ -151,7 +151,7 @@ __libc_fcntl (int fd, int cmd, ...)
+       switch (fl->l_type)
+         {
+         case F_RDLCK: cmd |= LOCK_SH; break;
+-        case F_WRLCK: cmd |= LOCK_EX; break;
++        case F_WRLCK: cmd |= LOCK_SH | LOCK_EX; break;
+         case F_UNLCK: cmd |= LOCK_UN; break;
+         default:
+           errno = EINVAL;
+-- 
+tg: (9a079e2..) t/WRLCK-upgrade (depends on: baseline)

Modified: glibc-package/trunk/debian/patches/series
===================================================================
--- glibc-package/trunk/debian/patches/series   2014-11-16 11:29:46 UTC (rev 
6333)
+++ glibc-package/trunk/debian/patches/series   2014-11-23 00:27:17 UTC (rev 
6334)
@@ -154,6 +154,7 @@
 hurd-i386/submitted-bind_umask2.diff
 hurd-i386/cvs-fork_ss_hang.diff
 hurd-i386/local-libpthread-stacksize.diff
+hurd-i386/tg-WRLCK-upgrade.diff
 
 i386/local-biarch.diff
 i386/local-cmov.diff


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]
Archive: https://lists.debian.org/[email protected]

Reply via email to