Index: branches/fc15-dev/server/common/patches/openafs-linux-3.1-fsync.patch
===================================================================
--- branches/fc15-dev/server/common/patches/openafs-linux-3.1-fsync.patch	(revision 2060)
+++ branches/fc15-dev/server/common/patches/openafs-linux-3.1-fsync.patch	(revision 2060)
@@ -0,0 +1,90 @@
+From: Marc Dionne <marc.c.dionne@gmail.com>
+Date: Fri, 2 Sep 2011 21:56:58 +0000 (-0400)
+Subject: Linux: 3.1: adapt to fsync changes
+X-Git-Url: http://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=81f28004415ae07f2e3a1320da632cbd52c96b25;hp=ef492dc1e1a1809a910fbf07140b26c4924957c5
+
+Linux: 3.1: adapt to fsync changes
+
+The fsync file operation gets new arguments to specify a range.
+Add a configure test to check for the API change.
+
+The inode lock is also pushed down into the operation, so we need
+to take it ourselves to keep the original behaviour.
+
+Reviewed-on: http://gerrit.openafs.org/5332
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
+Reviewed-by: Derrick Brashear <shadow@dementix.org>
+(cherry picked from commit cbaefa266d433af3b9a082a360e23a42f161d80f)
+
+Change-Id: Idb6770204b014c62a8611548509240f8b5f950bc
+---
+
+diff --git a/acinclude.m4 b/acinclude.m4
+index 3ff4551..35f2200 100644
+--- a/acinclude.m4
++++ b/acinclude.m4
+@@ -920,6 +920,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
+ 	  	 LINUX_DOP_D_REVALIDATE_TAKES_NAMEIDATA
+ 	  	 LINUX_FOP_F_FLUSH_TAKES_FL_OWNER_T
+ 	  	 LINUX_FOP_F_FSYNC_TAKES_DENTRY
++		 LINUX_FOP_F_FSYNC_TAKES_RANGE
+ 	  	 LINUX_AOP_WRITEBACK_CONTROL
+ 		 LINUX_FS_STRUCT_FOP_HAS_SPLICE
+ 		 LINUX_KERNEL_POSIX_LOCK_FILE_WAIT_ARG
+diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c
+index 696146b..019b568 100644
+--- a/src/afs/LINUX/osi_vnodeops.c
++++ b/src/afs/LINUX/osi_vnodeops.c
+@@ -425,6 +425,8 @@ afs_linux_release(struct inode *ip, struct file *fp)
+ static int
+ #if defined(FOP_FSYNC_TAKES_DENTRY)
+ afs_linux_fsync(struct file *fp, struct dentry *dp, int datasync)
++#elif defined(FOP_FSYNC_TAKES_RANGE)
++afs_linux_fsync(struct file *fp, loff_t start, loff_t end, int datasync)
+ #else
+ afs_linux_fsync(struct file *fp, int datasync)
+ #endif
+@@ -433,9 +435,15 @@ afs_linux_fsync(struct file *fp, int datasync)
+     struct inode *ip = FILE_INODE(fp);
+     cred_t *credp = crref();
+ 
++#if defined(FOP_FSYNC_TAKES_RANGE)
++    mutex_lock(&ip->i_mutex);
++#endif
+     AFS_GLOCK();
+     code = afs_fsync(VTOAFS(ip), credp);
+     AFS_GUNLOCK();
++#if defined(FOP_FSYNC_TAKES_RANGE)
++    mutex_unlock(&ip->i_mutex);
++#endif
+     crfree(credp);
+     return afs_convert_code(code);
+ 
+diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4
+index 2292f81..35082b3 100644
+--- a/src/cf/linux-test4.m4
++++ b/src/cf/linux-test4.m4
+@@ -414,6 +414,22 @@ struct dentry _d;
+ ])
+ 
+ 
++int (*fsync) (struct file *, loff_t start, loff_t end, int datasync);
++
++AC_DEFUN([LINUX_FOP_F_FSYNC_TAKES_RANGE], [
++  AC_CHECK_LINUX_BUILD([whether file_operations.fsync takes a range],
++		       [ac_cv_linux_func_f_fsync_takes_range],
++		       [#include <linux/fs.h>],
++[struct inode _inode;
++struct file _file;
++loff_t start, end;
++(void)_inode.i_fop->fsync(&_file, start, end, 0);],
++		       [FOP_FSYNC_TAKES_RANGE],
++		       [define if your fops.fsync takes range arguments],
++		       [])
++])
++
++
+ AC_DEFUN([LINUX_HAVE_KMEM_CACHE_T], [
+   AC_CHECK_LINUX_BUILD([whether kmem_cache_t exists],
+ 		       [ac_cv_linux_have_kmem_cache_t],
Index: branches/fc15-dev/server/common/patches/openafs-linux-3.1-rcu.patch
===================================================================
--- branches/fc15-dev/server/common/patches/openafs-linux-3.1-rcu.patch	(revision 2060)
+++ branches/fc15-dev/server/common/patches/openafs-linux-3.1-rcu.patch	(revision 2060)
@@ -0,0 +1,45 @@
+From f129142dde2a2637b2e638ca0cca372a45188923 Mon Sep 17 00:00:00 2001
+From: Marc Dionne <marc.c.dionne@gmail.com>
+Date: Sat, 29 Oct 2011 19:23:07 -0400
+Subject: [PATCH] Linux: 3.1: update RCU path walking detection in permission i_op
+
+The permission() inode operation changed again with kernel 3.1,
+back to the form it had before 2.6.38.  This compiles fine,
+but is missing the new way of detecting when we get called in
+RCU path walking mode, resulting in system hangs.
+
+Reviewed-on: http://gerrit.openafs.org/5740
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Derrick Brashear <shadow@dementix.org>
+(cherry picked from commit 4952df3f0359531e4a660c99c94c51eb0b169f59)
+
+Change-Id: Ibd497309e6699fb585cf70e618373e800b73cbb8
+Reviewed-on: http://gerrit.openafs.org/6088
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Derrick Brashear <shadow@dementix.org>
+---
+ src/afs/LINUX/osi_vnodeops.c |    5 ++++-
+ 1 files changed, 4 insertions(+), 1 deletions(-)
+
+diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c
+index e9215db..696146b 100644
+--- a/src/afs/LINUX/osi_vnodeops.c
++++ b/src/afs/LINUX/osi_vnodeops.c
+@@ -2245,10 +2245,13 @@ afs_linux_permission(struct inode *ip, int mode)
+     cred_t *credp;
+     int tmp = 0;
+ 
++    /* Check for RCU path walking */
+ #if defined(IOP_PERMISSION_TAKES_FLAGS)
+-    /* We don't support RCU path walking */
+     if (flags & IPERM_FLAG_RCU)
+        return -ECHILD;
++#elif defined(MAY_NOT_BLOCK)
++    if (mode & MAY_NOT_BLOCK)
++       return -ECHILD;
+ #endif
+ 
+     credp = crref();
+-- 
+1.7.2.5
+
Index: branches/fc15-dev/server/fedora/specs/openafs.spec.patch
===================================================================
--- branches/fc15-dev/server/fedora/specs/openafs.spec.patch	(revision 2058)
+++ branches/fc15-dev/server/fedora/specs/openafs.spec.patch	(revision 2060)
@@ -1,4 +1,4 @@
---- openafs.spec.orig	2011-06-20 15:32:57.000000000 -0400
-+++ openafs.spec	2011-06-21 17:15:24.000000000 -0400
+--- rpmbuild/SPECS/openafs.spec
++++ rpmbuild/SPECS/openafs.spec.~3~	2011-11-20 20:13:52.211673609 -0500
 @@ -4,7 +4,7 @@
  %define pkgvers 1.6.0
@@ -10,6 +10,6 @@
  %{!?fedorakmod: %define fedorakmod 1}
  %{!?build_dkmspkg: %define build_dkmspkg 1}
-@@ -247,6 +247,11 @@
- %endif
+@@ -237,6 +237,13 @@
+ 
  ExclusiveArch: %{ix86} x86_64 ia64 s390 s390x sparc64 ppc ppc64
  
@@ -18,9 +18,11 @@
 +Patch1002: openafs-systemd.patch
 +Patch1003: openafs-systemd-crond.patch
++Patch1004: openafs-linux-3.1-rcu.patch
++Patch1005: openafs-linux-3.1-fsync.patch
 +
  #    http://dl.openafs.org/dl/openafs/candidate/%{afsvers}/...
  Source0: http://www.openafs.org/dl/openafs/%{afsvers}/openafs-%{afsvers}-src.tar.bz2
  Source1: http://www.openafs.org/dl/openafs/%{afsvers}/openafs-%{afsvers}-doc.tar.bz2
-@@ -326,6 +329,7 @@
+@@ -316,6 +323,7 @@
  %if %{build_userspace}
  
@@ -30,5 +32,5 @@
  
  %if %{fedorakmod}
-@@ -386,6 +390,7 @@
+@@ -376,6 +384,7 @@
  
  %if %{build_authlibs}
@@ -38,5 +40,5 @@
  Group: Networking/Filesystems
  
-@@ -402,6 +407,7 @@
+@@ -392,6 +401,7 @@
  %endif
  
@@ -44,7 +46,7 @@
 +Provides: scripts-openafs-authlibs-devel
  %if %{build_authlibs}
- Requires: openafs-authlibs = %{version}
+ Requires: openafs-authlibs = %{version}-%{release}
  %endif
-@@ -420,6 +426,7 @@
+@@ -410,6 +420,7 @@
  libraries.
  
@@ -53,6 +55,6 @@
  Summary: OpenAFS Development Libraries and Headers
  Group: Development/Filesystems
- 
-@@ -448,6 +455,7 @@
+ Requires: openafs = %{version}-%{release}
+@@ -439,6 +450,7 @@
  administrators.
  
@@ -62,5 +64,5 @@
  Group: Networking/Filesystems
  Provides: openafs-kernel = %{version}
-@@ -497,6 +505,7 @@
+@@ -488,6 +500,7 @@
  
  %if %{krb5support}
@@ -70,5 +72,5 @@
  Requires: openafs = %{version}
  Group: Networking/Filesystems
-@@ -523,7 +532,7 @@
+@@ -514,7 +527,7 @@
  %if %{build_modules}
  
@@ -79,5 +81,5 @@
  %else
  
-@@ -680,6 +689,12 @@
+@@ -671,6 +684,14 @@
  #%setup -q -n %{srcdir}
  %setup -q -b 1 -n %{srcdir}
@@ -88,9 +90,11 @@
 +%patch1002 -p1 -b .systemd
 +%patch1003 -p1 -b .systemd-crond
++%patch1004 -p1 -b .rcu
++%patch1005 -p1 -b .fsync
 +
  ##############################################################################
  #
  # building
-@@ -1215,6 +1230,13 @@
+@@ -1212,6 +1233,13 @@
  rm -f $RPM_BUILD_ROOT%{_libdir}/libafsrpc.so
  rm -f $RPM_BUILD_ROOT%{_libdir}/libafsauthent.so.*
