Index: /trunk/server/common/patches/openafs-afs_conn-overcounts.patch
===================================================================
--- /trunk/server/common/patches/openafs-afs_conn-overcounts.patch	(revision 2658)
+++ /trunk/server/common/patches/openafs-afs_conn-overcounts.patch	(revision 2659)
@@ -1,3 +1,3 @@
-From 368fff3b2fef5b559ed6da016e1e9f0413b55552 Mon Sep 17 00:00:00 2001
+From 54c0ee608f4afd2b178c9b60eabfc3564293d996 Mon Sep 17 00:00:00 2001
 From: Andrew Deason <adeason@sinenomine.net>
 Date: Sun, 14 Sep 2014 14:10:11 -0500
@@ -37,4 +37,9 @@
 
 Change-Id: I3a52f8ccef24f01d04c02db0a4b711405360e323
+Reviewed-on: http://gerrit.openafs.org/11464
+Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
+Reviewed-by: Daria Brashear <shadow@your-file-system.com>
+Tested-by: Benjamin Kaduk <kaduk@mit.edu>
+Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
 ---
  src/afs/afs_bypasscache.c | 1 +
@@ -43,8 +48,8 @@
 
 diff --git a/src/afs/afs_bypasscache.c b/src/afs/afs_bypasscache.c
-index 744feb2..8fc6009 100644
+index f452638..4c6fb9a 100644
 --- a/src/afs/afs_bypasscache.c
 +++ b/src/afs/afs_bypasscache.c
-@@ -637,6 +637,7 @@ afs_PrefetchNoCache(struct vcache *avc,
+@@ -621,6 +621,7 @@ afs_PrefetchNoCache(struct vcache *avc,
  	    } else {
  		afs_warn("BYPASS: StartRXAFS_FetchData failed: %d\n", code);
@@ -55,8 +60,8 @@
  	    if (code == 0) {
 diff --git a/src/afs/afs_dcache.c b/src/afs/afs_dcache.c
-index dc1e039..a156e22 100644
+index 4a9edbd..338e8db 100644
 --- a/src/afs/afs_dcache.c
 +++ b/src/afs/afs_dcache.c
-@@ -2399,6 +2399,13 @@ afs_GetDCache(struct vcache *avc, afs_size_t abyte,
+@@ -2398,6 +2398,13 @@ afs_GetDCache(struct vcache *avc, afs_size_t abyte,
  			afs_PutDCache(tdc);
  			tdc = 0;
@@ -73,4 +78,4 @@
  		    }
 -- 
-2.2.0
+2.2.1
 
Index: unk/server/common/patches/openafs-afs_lookup-return.patch
===================================================================
--- /trunk/server/common/patches/openafs-afs_lookup-return.patch	(revision 2658)
+++ 	(revision )
@@ -1,66 +1,0 @@
-From 100e35ed19e2c255986cb330b0f56f706acc6e7b Mon Sep 17 00:00:00 2001
-From: Andrew Deason <adeason@sinenomine.net>
-Date: Thu, 24 Jul 2014 11:07:45 -0500
-Subject: [PATCH] LINUX: Check afs_lookup return code explicitly
-
-Checking if the returned vcache is NULL or not is a bit of an indirect
-way to check if an error occurred. Just check the return code itself,
-to make sure we notice if any kind of error is reported.
-
-Suggested by Chas Williams.
-
-Reviewed-on: http://gerrit.openafs.org/11321
-Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
-Tested-by: BuildBot <buildbot@rampaginggeek.com>
-Reviewed-by: D Brashear <shadow@your-file-system.com>
-(cherry picked from commit 2edf5c0382385f898a017fd8e0e2429f8b2b3520)
-
-Change-Id: I7e123ab1cf88570a6b18e438e01409ed7804e014
----
- src/afs/LINUX/osi_vnodeops.c | 9 +++++----
- 1 file changed, 5 insertions(+), 4 deletions(-)
-
-diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c
-index 7e5cdd1..9ed6f01 100644
---- a/src/afs/LINUX/osi_vnodeops.c
-+++ b/src/afs/LINUX/osi_vnodeops.c
-@@ -943,6 +943,7 @@ check_bad_parent(struct dentry *dp)
-     cred_t *credp;
-     struct dentry *parent;
-     struct vcache *vcp, *pvc, *avc = NULL;
-+    int code;
- 
-     vcp = VTOAFS(dp->d_inode);
-     parent = dget_parent(dp);
-@@ -952,8 +953,8 @@ check_bad_parent(struct dentry *dp)
- 	credp = crref();
- 
- 	/* force a lookup, so vcp->mvid is fixed up */
--	afs_lookup(pvc, (char *)dp->d_name.name, &avc, credp);
--	if (!avc || vcp != avc) {	/* bad, very bad.. */
-+	code = afs_lookup(pvc, (char *)dp->d_name.name, &avc, credp);
-+	if (code || vcp != avc) {	/* bad, very bad.. */
- 	    afs_Trace4(afs_iclSetp, CM_TRACE_TMP_1S3L, ICL_TYPE_STRING,
- 		       "check_bad_parent: bad pointer returned from afs_lookup origvc newvc dentry",
- 		       ICL_TYPE_POINTER, vcp, ICL_TYPE_POINTER, avc,
-@@ -1233,7 +1234,7 @@ afs_linux_dentry_revalidate(struct dentry *dp, int flags)
- 
- 	    credp = crref();
- 	    code = afs_lookup(pvcp, (char *)dp->d_name.name, &tvc, credp);
--	    if (!tvc || tvc != vcp) {
-+	    if (code || tvc != vcp) {
- 		dput(parent);
- 		/* Force unhash; the name doesn't point to this file
- 		 * anymore. */
-@@ -1478,7 +1479,7 @@ afs_linux_lookup(struct inode *dip, struct dentry *dp)
-     AFS_GLOCK();
-     code = afs_lookup(VTOAFS(dip), (char *)comp, &vcp, credp);
-     
--    if (vcp) {
-+    if (!code) {
- 	struct vattr *vattr = NULL;
- 	struct vcache *parent_vc = VTOAFS(dip);
- 
--- 
-2.1.2
-
Index: unk/server/common/patches/openafs-d_revalidate-mtpt.patch
===================================================================
--- /trunk/server/common/patches/openafs-d_revalidate-mtpt.patch	(revision 2658)
+++ 	(revision )
@@ -1,92 +1,0 @@
-From c9bbebe869acadd61abfa50656447429cde18aaf Mon Sep 17 00:00:00 2001
-From: Andrew Deason <adeason@sinenomine.net>
-Date: Tue, 28 Oct 2014 00:10:56 -0500
-Subject: [PATCH] LINUX: Avoid d_revalidate failure on mtpt mismatch
-
-Currently, if afs_linux_dentry_revalidate is given an inode that
-corresponds to a mtpt vcache ('vcp'), it resolves the mtpt to its root
-dir if it's easy to do so (mvid and CMValid are set). Later on, we run
-afs_lookup to see if looking up our dentry's name returns the same
-vcache that we got; afs_lookup presumably will also resolve the mtpt
-if it's easy to do so.
-
-However, it is possible that afs_linux_dentry_revalidate and
-afs_lookup will make different decisions as to whether or not they
-resolve a mtpt to a dir. Specifically, if CMValid is cleared after
-afs_linux_dentry_revalidate checks for it, but before afs_lookup does,
-then afs_lookup will return a different vcache than
-afs_linux_dentry_revalidate is expecting, even though the relevant
-directory entry has not changed. That is, tvc is not equal to vcp, but
-tvc could be a mtpt that resolves to vcp, or vice versa. CMValid can
-be cleared by another thread at virtually any time, since this is
-cleared in some situations when we're not sure if the mtpt resolution
-is still valid (callbacks are broken, vldb cache entries expire, etc).
-
-afs_linux_dentry_revalidate interprets this situation to mean that the
-directory entry has changed, and so it eventually d_drop's the
-associated dentry. The way that this manifests to users is that a
-"fakestatted" mtpt can appear to be deleted effectively randomly, even
-when nothing has changed. This can be a problem because this causes
-the getcwd() syscall to return ENOENT when the working directory
-involves such an affected directory.
-
-To fix this situation, we just detect if afs_lookup returned either
-'vcp' (our possibly-resolved vcache), or the original inode associated
-with the dentry we are revalidating. If the returned vcache matches
-either of these, then the entry is okay and we don't need to
-invalidate or drop anything.
-
-FIXES 131780
-
-Change-Id: Ide1dd224d1ea1e29a82eb7130a010877cf4e9fc7
-(cherry picked from commit 45d9ff86571cbe70fedd524266fac50bd2d4bc2d)
----
- src/afs/LINUX/osi_vnodeops.c | 29 ++++++++++++++++++++++++++++-
- 1 file changed, 28 insertions(+), 1 deletion(-)
-
-diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c
-index 9ed6f01..8c63f96 100644
---- a/src/afs/LINUX/osi_vnodeops.c
-+++ b/src/afs/LINUX/osi_vnodeops.c
-@@ -1231,10 +1231,37 @@ afs_linux_dentry_revalidate(struct dentry *dp, int flags)
- 	if (hgetlo(pvcp->f.m.DataVersion) > dp->d_time || !(vcp->f.states & CStatd)) {
- 	    struct vattr *vattr = NULL;
- 	    int code;
-+	    int lookup_good;
- 
- 	    credp = crref();
- 	    code = afs_lookup(pvcp, (char *)dp->d_name.name, &tvc, credp);
--	    if (code || tvc != vcp) {
-+
-+	    if (code) {
-+		/* We couldn't perform the lookup, so we're not okay. */
-+		lookup_good = 0;
-+
-+	    } else if (tvc == vcp) {
-+		/* We got back the same vcache, so we're good. */
-+		lookup_good = 1;
-+
-+	    } else if (tvc == VTOAFS(dp->d_inode)) {
-+		/* We got back the same vcache, so we're good. This is
-+		 * different from the above case, because sometimes 'vcp' is
-+		 * not the same as the vcache for dp->d_inode, if 'vcp' was a
-+		 * mtpt and we evaluated it to a root dir. In rare cases,
-+		 * afs_lookup might not evalute the mtpt when we do, or vice
-+		 * versa, so the previous case will not succeed. But this is
-+		 * still 'correct', so make sure not to mark the dentry as
-+		 * invalid; it still points to the same thing! */
-+		lookup_good = 1;
-+
-+	    } else {
-+		/* We got back a different file, so we're definitely not
-+		 * okay. */
-+		lookup_good = 0;
-+	    }
-+
-+	    if (!lookup_good) {
- 		dput(parent);
- 		/* Force unhash; the name doesn't point to this file
- 		 * anymore. */
--- 
-2.1.2
-
Index: /trunk/server/common/patches/openafs-d_splice_alias-reference.patch
===================================================================
--- /trunk/server/common/patches/openafs-d_splice_alias-reference.patch	(revision 2658)
+++ /trunk/server/common/patches/openafs-d_splice_alias-reference.patch	(revision 2659)
@@ -1,3 +1,3 @@
-From 1c576fdf9f05c6af7b5b029ba010a76bed48488e Mon Sep 17 00:00:00 2001
+From b1f23baecb2de72b44cda8bba27615c012a445f1 Mon Sep 17 00:00:00 2001
 From: Marc Dionne <marc.dionne@your-file-system.com>
 Date: Thu, 18 Dec 2014 08:43:22 -0500
@@ -18,12 +18,27 @@
 Change-Id: Id1786ac2227b4d8e0ae801fe59c15a0ecd975bed
 ---
- src/afs/LINUX/osi_vnodeops.c | 25 ++++++++++++++++++++++---
- 1 file changed, 22 insertions(+), 3 deletions(-)
+ acinclude.m4                 |  3 +++
+ src/afs/LINUX/osi_vnodeops.c | 29 ++++++++++++++++++++++++++---
+ 2 files changed, 29 insertions(+), 3 deletions(-)
 
+diff --git a/acinclude.m4 b/acinclude.m4
+index 96adde0..19f7092 100644
+--- a/acinclude.m4
++++ b/acinclude.m4
+@@ -984,6 +984,9 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
+ 		 AC_CHECK_LINUX_FUNC([hlist_unhashed],
+ 				     [#include <linux/list.h>],
+ 				     [hlist_unhashed(0);])
++		 AC_CHECK_LINUX_FUNC([ihold],
++				     [#include <linux/fs.h>],
++				     [ihold(NULL);])
+ 		 AC_CHECK_LINUX_FUNC([i_size_read],
+ 				     [#include <linux/fs.h>],
+ 				     [i_size_read(NULL);])
 diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c
-index b2ab9d5..3723cf8 100644
+index b2ab9d5..cedfef6 100644
 --- a/src/afs/LINUX/osi_vnodeops.c
 +++ b/src/afs/LINUX/osi_vnodeops.c
-@@ -1612,6 +1612,13 @@ afs_linux_lookup(struct inode *dip, struct dentry *dp)
+@@ -1612,6 +1612,17 @@ afs_linux_lookup(struct inode *dip, struct dentry *dp)
  	ip->i_flags |= S_AUTOMOUNT;
  #endif
@@ -34,10 +49,14 @@
 +     */
 +    if (ip)
++#ifdef HAVE_LINUX_IHOLD
++	ihold(ip);
++#else
 +	igrab(ip);
++#endif
 +
      newdp = d_splice_alias(ip, dp);
  
   done:
-@@ -1625,14 +1632,26 @@ afs_linux_lookup(struct inode *dip, struct dentry *dp)
+@@ -1625,14 +1636,26 @@ afs_linux_lookup(struct inode *dip, struct dentry *dp)
  	 * d_splice_alias can return an error (EIO) if there is an existing
  	 * connected directory alias for this dentry.
Index: /trunk/server/common/patches/openafs-d_u.d_alias.patch
===================================================================
--- /trunk/server/common/patches/openafs-d_u.d_alias.patch	(revision 2659)
+++ /trunk/server/common/patches/openafs-d_u.d_alias.patch	(revision 2659)
@@ -0,0 +1,324 @@
+From 2c9bc3ec349ae550bf60d0c46f15bdabe2b0fd9e Mon Sep 17 00:00:00 2001
+From: Marc Dionne <marc.dionne@your-file-system.com>
+Date: Thu, 18 Dec 2014 06:57:22 -0500
+Subject: [PATCH 1/2] Linux: Move code to reset the root to afs/LINUX
+
+Move the Linux specific bit of code to reset the root to
+afs/LINUX platform specific files.  Things that play with
+the Linux vfs internals should not be exposed here.
+
+No functional change, but this helps cleanup some ifdef
+mess.
+
+Change-Id: Ia27fca3d8052ead45783cb2332c04fe6e99e5d9f
+---
+ src/afs/LINUX/osi_prototypes.h   |  3 ++
+ src/afs/LINUX/osi_vcache.c       | 61 ++++++++++++++++++++++++++++++++++++
+ src/afs/LINUX24/osi_prototypes.h |  3 ++
+ src/afs/LINUX24/osi_vcache.c     | 36 +++++++++++++++++++++
+ src/afs/afs_daemons.c            | 67 +++-------------------------------------
+ 5 files changed, 108 insertions(+), 62 deletions(-)
+
+diff --git a/src/afs/LINUX/osi_prototypes.h b/src/afs/LINUX/osi_prototypes.h
+index 277b50a..5002af1 100644
+--- a/src/afs/LINUX/osi_prototypes.h
++++ b/src/afs/LINUX/osi_prototypes.h
+@@ -82,6 +82,9 @@ extern void osi_VM_FlushPages(struct vcache *avc, afs_ucred_t *credp);
+ extern void osi_VM_Truncate(struct vcache *avc, int alen,
+ 			    afs_ucred_t *acred);
+ 
++/* osi_vcache.c */
++extern void osi_ResetRootVCache(afs_uint32 volid);
++
+ /* osi_vfsops.c */
+ extern void vattr2inode(struct inode *ip, struct vattr *vp);
+ extern int afs_init_inodecache(void);
+diff --git a/src/afs/LINUX/osi_vcache.c b/src/afs/LINUX/osi_vcache.c
+index 1d0db82..391e7d4 100644
+--- a/src/afs/LINUX/osi_vcache.c
++++ b/src/afs/LINUX/osi_vcache.c
+@@ -143,3 +143,64 @@ osi_PostPopulateVCache(struct vcache *avc) {
+     vSetType(avc, VREG);
+ }
+ 
++/**
++ * osi_ResetRootVCache - Reset the root vcache
++ * Reset the dentry associated with the afs root.
++ * Called from afs_CheckRootVolume when we notice that
++ * the root volume ID has changed.
++ *
++ * @volid: volume ID for the afs root
++ */
++void
++osi_ResetRootVCache(afs_uint32 volid)
++{
++    struct vrequest *treq = NULL;
++    struct vattr vattr;
++    cred_t *credp;
++    struct dentry *dp;
++    struct vcache *vcp;
++    struct inode *root = AFSTOV(afs_globalVp);
++
++    afs_rootFid.Fid.Volume = volid;
++    afs_rootFid.Fid.Vnode = 1;
++    afs_rootFid.Fid.Unique = 1;
++
++    credp = crref();
++    if (afs_CreateReq(&treq, credp))
++	goto out;
++    vcp = afs_GetVCache(&afs_rootFid, treq, NULL, NULL);
++    if (!vcp)
++	goto out;
++    afs_getattr(vcp, &vattr, credp);
++    afs_fill_inode(AFSTOV(vcp), &vattr);
++
++    dp = d_find_alias(root);
++
++#if defined(HAVE_DCACHE_LOCK)
++    spin_lock(&dcache_lock);
++#else
++    spin_lock(&AFSTOV(vcp)->i_lock);
++#endif
++    spin_lock(&dp->d_lock);
++#if defined(D_ALIAS_IS_HLIST)
++    hlist_del_init(&dp->d_alias);
++    hlist_add_head(&dp->d_alias, &(AFSTOV(vcp)->i_dentry));
++#else
++    list_del_init(&dp->d_alias);
++    list_add(&dp->d_alias, &(AFSTOV(vcp)->i_dentry));
++#endif
++    dp->d_inode = AFSTOV(vcp);
++    spin_unlock(&dp->d_lock);
++#if defined(HAVE_DCACHE_LOCK)
++    spin_unlock(&dcache_lock);
++#else
++    spin_unlock(&AFSTOV(vcp)->i_lock);
++#endif
++    dput(dp);
++
++    AFS_RELE(root);
++    afs_globalVp = vcp;
++out:
++    crfree(credp);
++    afs_DestroyReq(treq);
++}
+diff --git a/src/afs/LINUX24/osi_prototypes.h b/src/afs/LINUX24/osi_prototypes.h
+index cb4bee1..cd748f1 100644
+--- a/src/afs/LINUX24/osi_prototypes.h
++++ b/src/afs/LINUX24/osi_prototypes.h
+@@ -69,6 +69,9 @@ extern void osi_syscall_clean(void);
+ extern int osi_sysctl_init(void);
+ extern void osi_sysctl_clean(void);
+ 
++/* osi_vcache.c */
++extern void osi_ResetRootVCache(afs_uint32 volid);
++
+ /* osi_vm.c */
+ extern int osi_VM_FlushVCache(struct vcache *avc);
+ extern void osi_VM_TryToSmush(struct vcache *avc, afs_ucred_t *acred,
+diff --git a/src/afs/LINUX24/osi_vcache.c b/src/afs/LINUX24/osi_vcache.c
+index bbaf5ce..853a357 100644
+--- a/src/afs/LINUX24/osi_vcache.c
++++ b/src/afs/LINUX24/osi_vcache.c
+@@ -119,3 +119,39 @@ osi_PostPopulateVCache(struct vcache *avc) {
+     vSetType(avc, VREG);
+ }
+ 
++void
++osi_ResetRootVCache(afs_uint32 volid)
++{
++    struct vrequest *treq = NULL;
++    struct vattr vattr;
++    cred_t *credp;
++    struct dentry *dp;
++    struct vcache *vcp;
++
++    afs_rootFid.Fid.Volume = volid;
++    afs_rootFid.Fid.Vnode = 1;
++    afs_rootFid.Fid.Unique = 1;
++
++    credp = crref();
++    if (afs_CreateReq(&treq, credp))
++	goto out;
++    vcp = afs_GetVCache(&afs_rootFid, treq, NULL, NULL);
++    if (!vcp)
++	goto out;
++    afs_getattr(vcp, &vattr, credp);
++    afs_fill_inode(AFSTOV(vcp), &vattr);
++
++    dp = d_find_alias(AFSTOV(afs_globalVp));
++    spin_lock(&dcache_lock);
++    list_del_init(&dp->d_alias);
++    list_add(&dp->d_alias, &(AFSTOV(vcp)->i_dentry));
++    dp->d_inode = AFSTOV(vcp);
++    spin_unlock(&dcache_lock);
++    dput(dp);
++
++    AFS_FAST_RELE(afs_globalVp);
++    afs_globalVp = vcp;
++out:
++    crfree(credp);
++    afs_DestroyReq(treq);
++}
+diff --git a/src/afs/afs_daemons.c b/src/afs/afs_daemons.c
+index a78aaaa..dd943a7 100644
+--- a/src/afs/afs_daemons.c
++++ b/src/afs/afs_daemons.c
+@@ -351,71 +351,14 @@ afs_CheckRootVolume(void)
+ 		 * count to zero and fs checkv is executed when the current
+ 		 * directory is /afs.
+ 		 */
+-#ifdef AFS_LINUX20_ENV
+-		{
+-		    struct vrequest *treq = NULL;
+-		    struct vattr vattr;
+-		    cred_t *credp;
+-		    struct dentry *dp;
+-		    struct vcache *vcp;
+-
+-		    afs_rootFid.Fid.Volume = volid;
+-		    afs_rootFid.Fid.Vnode = 1;
+-		    afs_rootFid.Fid.Unique = 1;
+-
+-		    credp = crref();
+-		    if (afs_CreateReq(&treq, credp))
+-			goto out;
+-		    vcp = afs_GetVCache(&afs_rootFid, treq, NULL, NULL);
+-		    if (!vcp)
+-			goto out;
+-		    afs_getattr(vcp, &vattr, credp);
+-		    afs_fill_inode(AFSTOV(vcp), &vattr);
+-
+-		    dp = d_find_alias(AFSTOV(afs_globalVp));
+-
+-#if defined(AFS_LINUX24_ENV)
+-#if defined(HAVE_DCACHE_LOCK)
+-		    spin_lock(&dcache_lock);
+-#else
+-		    spin_lock(&AFSTOV(vcp)->i_lock);
+-#endif
+-#if defined(AFS_LINUX26_ENV)
+-		    spin_lock(&dp->d_lock);
+-#endif
+-#endif
+-#if defined(D_ALIAS_IS_HLIST)
+-		    hlist_del_init(&dp->d_alias);
+-		    hlist_add_head(&dp->d_alias, &(AFSTOV(vcp)->i_dentry));
+-#else
+-		    list_del_init(&dp->d_alias);
+-		    list_add(&dp->d_alias, &(AFSTOV(vcp)->i_dentry));
+-#endif
+-		    dp->d_inode = AFSTOV(vcp);
+-#if defined(AFS_LINUX24_ENV)
+-#if defined(AFS_LINUX26_ENV)
+-		    spin_unlock(&dp->d_lock);
+-#endif
+-#if defined(HAVE_DCACHE_LOCK)
+-		    spin_unlock(&dcache_lock);
+-#else
+-		    spin_unlock(&AFSTOV(vcp)->i_lock);
+-#endif
+-#endif
+-		    dput(dp);
+-
+-		    AFS_FAST_RELE(afs_globalVp);
+-		    afs_globalVp = vcp;
+-		out:
+-		    crfree(credp);
+-		    afs_DestroyReq(treq);
+-		}
++#ifdef AFS_LINUX22_ENV
++		osi_ResetRootVCache(volid);
+ #else
+-#ifdef AFS_DARWIN80_ENV
++# ifdef AFS_DARWIN80_ENV
+ 		afs_PutVCache(afs_globalVp);
+-#else
++# else
+ 		AFS_FAST_RELE(afs_globalVp);
+-#endif
++# endif
+ 		afs_globalVp = 0;
+ #endif
+ 	    }
+-- 
+2.2.1
+
+
+From 4ba5cbd90e96edd63bd0178df8ce615c1efe1b2c Mon Sep 17 00:00:00 2001
+From: Marc Dionne <marc.dionne@your-file-system.com>
+Date: Thu, 18 Dec 2014 07:13:46 -0500
+Subject: [PATCH 2/2] Linux: d_alias becomes d_u.d_alias
+
+The fields in struct dentry are re-arranged so that d_alias
+shares space wth d_rcu inside the d_u union.  Some references
+need to change from d_alias to d_u.d_alias.
+
+The kernel change was introduced for 3.19 but was also backported
+to the 3.18 stable series in 3.18.1, so this commit is required
+for 3.19 and current 3.18 kernels.
+
+Change-Id: I711a5a3a89af6e0055381dfd4474ddca2868bb9c
+---
+ acinclude.m4               | 1 +
+ src/afs/LINUX/osi_compat.h | 4 ++++
+ src/cf/linux-test4.m4      | 9 ++++++++-
+ 3 files changed, 13 insertions(+), 1 deletion(-)
+
+diff --git a/acinclude.m4 b/acinclude.m4
+index 96adde0..e8e238b 100644
+--- a/acinclude.m4
++++ b/acinclude.m4
+@@ -899,6 +899,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
+ 				       [backing-dev.h])
+ 		 AC_CHECK_LINUX_STRUCT([cred], [session_keyring], [cred.h])
+ 		 AC_CHECK_LINUX_STRUCT([ctl_table], [ctl_name], [sysctl.h])
++		 AC_CHECK_LINUX_STRUCT([dentry], [d_u.d_alias], [dcache.h])
+ 		 AC_CHECK_LINUX_STRUCT([dentry_operations], [d_automount], [dcache.h])
+ 		 AC_CHECK_LINUX_STRUCT([inode], [i_alloc_sem], [fs.h])
+ 		 AC_CHECK_LINUX_STRUCT([inode], [i_blkbits], [fs.h])
+diff --git a/src/afs/LINUX/osi_compat.h b/src/afs/LINUX/osi_compat.h
+index 57f6ea7..497b1ef 100644
+--- a/src/afs/LINUX/osi_compat.h
++++ b/src/afs/LINUX/osi_compat.h
+@@ -37,6 +37,10 @@ typedef struct vfs_path afs_linux_path_t;
+ typedef struct path afs_linux_path_t;
+ #endif
+ 
++#if defined(STRUCT_DENTRY_HAS_D_U_D_ALIAS)
++# define d_alias d_u.d_alias
++#endif
++
+ #ifndef HAVE_LINUX_DO_SYNC_READ
+ static inline int
+ do_sync_read(struct file *fp, char *buf, size_t count, loff_t *offp) {
+diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4
+index f0269b3..9dd55b3 100644
+--- a/src/cf/linux-test4.m4
++++ b/src/cf/linux-test4.m4
+@@ -713,7 +713,11 @@ AC_DEFUN([LINUX_D_ALIAS_IS_HLIST], [
+ 			[#include <linux/fs.h>],
+ 			[struct dentry *d = NULL;
+ 			struct hlist_node *hn = NULL;
+-			d->d_alias = *hn;],
++			#if defined(STRUCT_DENTRY_HAS_D_U_D_ALIAS)
++			d->d_u.d_alias = *hn;
++			#else
++			d->d_alias = *hn;
++			#endif],
+ 			[D_ALIAS_IS_HLIST],
+ 			[define if dentry->d_alias is an hlist],
+ 			[])
+@@ -727,6 +731,9 @@ AC_DEFUN([LINUX_HLIST_ITERATOR_NO_NODE], [
+ 			#include <linux/fs.h>],
+ 			[struct dentry *d = NULL, *cur;
+ 			struct inode *ip;
++			#if defined(STRUCT_DENTRY_HAS_D_U_D_ALIAS)
++			# define d_alias d_u.d_alias
++			#endif
+ 			hlist_for_each_entry(cur, &ip->i_dentry, d_alias) { }
+ 			],
+ 			[HLIST_ITERATOR_NO_NODE],
+-- 
+2.2.1
+
Index: unk/server/common/patches/openafs-linux-3.17.patch
===================================================================
--- /trunk/server/common/patches/openafs-linux-3.17.patch	(revision 2658)
+++ 	(revision )
@@ -1,130 +1,0 @@
-From 75f36df74bb3c13aadb047163b93d6c24436f784 Mon Sep 17 00:00:00 2001
-From: Marc Dionne <marc.dionne@your-file-system.com>
-Date: Tue, 9 Sep 2014 10:39:55 -0300
-Subject: [PATCH 1/2] Linux 3.17: No more typedef for ctl_table
-
-The typedef has been removed so we need to use the structure
-directly.
-
-Note that the API for register_sysctl_table has also changed
-with 3.17, but it reverted back to a form that existed
-before and the configure tests handle it correctly.
-
-Reviewed-on: http://gerrit.openafs.org/11455
-Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
-Tested-by: BuildBot <buildbot@rampaginggeek.com>
-Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
-Reviewed-by: Andrew Deason <adeason@sinenomine.net>
-Reviewed-by: D Brashear <shadow@your-file-system.com>
-(cherry picked from commit 6a23ca5b6e8bcaf881be7a4c50bfba72d001e6cd)
-
-Change-Id: Ifb8fc0b9b01d2578c65407608f0e1b3f3b254459
-Reviewed-on: http://gerrit.openafs.org/11549
-Tested-by: BuildBot <buildbot@rampaginggeek.com>
-Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
-Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
----
- src/afs/LINUX/osi_sysctl.c | 4 ++--
- src/cf/linux-test4.m4      | 2 +-
- 2 files changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/src/afs/LINUX/osi_sysctl.c b/src/afs/LINUX/osi_sysctl.c
-index a8f7fac..834e8ad 100644
---- a/src/afs/LINUX/osi_sysctl.c
-+++ b/src/afs/LINUX/osi_sysctl.c
-@@ -34,7 +34,7 @@ extern afs_int32 afs_pct2;
- #ifdef CONFIG_SYSCTL
- static struct ctl_table_header *afs_sysctl = NULL;
- 
--static ctl_table afs_sysctl_table[] = {
-+static struct ctl_table afs_sysctl_table[] = {
-     {
- #if defined(STRUCT_CTL_TABLE_HAS_CTL_NAME)
- #if defined(CTL_UNNUMBERED)
-@@ -234,7 +234,7 @@ static ctl_table afs_sysctl_table[] = {
-     {0}
- };
- 
--static ctl_table fs_sysctl_table[] = {
-+static struct ctl_table fs_sysctl_table[] = {
-     {
- #if defined(STRUCT_CTL_TABLE_HAS_CTL_NAME)
- #if defined(CTL_UNNUMBERED)
-diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4
-index b068af5..1759d9e 100644
---- a/src/cf/linux-test4.m4
-+++ b/src/cf/linux-test4.m4
-@@ -395,7 +395,7 @@ AC_DEFUN([LINUX_REGISTER_SYSCTL_TABLE_NOFLAG], [
-   AC_CHECK_LINUX_BUILD([whether register_sysctl_table has an insert_at_head argument],
- 		       [ac_cv_linux_register_sysctl_table_noflag],
- 		       [#include <linux/sysctl.h>],
--		       [ctl_table *t; register_sysctl_table (t);],
-+		       [struct ctl_table *t; register_sysctl_table (t);],
- 		       [REGISTER_SYSCTL_TABLE_NOFLAG],
- 		       [define if register_sysctl_table has no insert_at head flag],
- 		       [])
--- 
-2.2.0.rc1
-
-From 663bdfcb16ab742ef12acca110f279b749f15586 Mon Sep 17 00:00:00 2001
-From: Marc Dionne <marc.dionne@your-file-system.com>
-Date: Thu, 25 Sep 2014 07:52:12 -0300
-Subject: [PATCH 2/2] Linux 3.17: Deal with d_splice_alias errors
-
-In 3.17 the logic in d_splice_alias has changed.  Of interest to
-us is the fact that it will now return an EIO error if it finds
-an existing connected directory for the dentry, where it would
-previously have added a new alias for it.  As a result the end
-user can get EIO errors when accessing any file in a volume
-if the volume was first accessed through a different path (ex:
-RO path vs RW path).
-
-This commit just restores the old behaviour, adding the directory
-alias manually in the error case, which is what older versions
-of d_splice_alias used to do.
-
-Reviewed-on: http://gerrit.openafs.org/11492
-Tested-by: BuildBot <buildbot@rampaginggeek.com>
-Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
-Reviewed-by: Andrew Deason <adeason@sinenomine.net>
-Reviewed-by: D Brashear <shadow@your-file-system.com>
-(cherry picked from commit 5815ee92a41cdcf105741d834042a5617dc4c219)
-
-Change-Id: Ie86009ede93255c85fcf640af14c598fe1e42ca9
-Reviewed-on: http://gerrit.openafs.org/11550
-Tested-by: BuildBot <buildbot@rampaginggeek.com>
-Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
-Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
----
- src/afs/LINUX/osi_vnodeops.c | 15 ++++++++++++---
- 1 file changed, 12 insertions(+), 3 deletions(-)
-
-diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c
-index 7e5cdd1..3ddcf42 100644
---- a/src/afs/LINUX/osi_vnodeops.c
-+++ b/src/afs/LINUX/osi_vnodeops.c
-@@ -1529,9 +1529,18 @@ afs_linux_lookup(struct inode *dip, struct dentry *dp)
-     /* It's ok for the file to not be found. That's noted by the caller by
-      * seeing that the dp->d_inode field is NULL.
-      */
--    if (!code || code == ENOENT)
--	return newdp;
--    else 
-+    if (!code || code == ENOENT) {
-+	/*
-+	 * d_splice_alias can return an error (EIO) if there is an existing
-+	 * connected directory alias for this dentry.
-+	 */
-+	if (!IS_ERR(newdp))
-+	    return newdp;
-+	else {
-+	    d_add(dp, ip);
-+	    return NULL;
-+	}
-+    } else
- 	return ERR_PTR(afs_convert_code(code));
- }
- 
--- 
-2.2.0.rc1
-
Index: unk/server/common/patches/openafs-systemd-crond.patch
===================================================================
--- /trunk/server/common/patches/openafs-systemd-crond.patch	(revision 2658)
+++ 	(revision )
@@ -1,13 +1,0 @@
-diff --git a/src/packaging/RedHat/openafs-client.service b/src/packaging/RedHat/openafs-client.service
-index 936762e..c0558b2 100644
---- a/src/packaging/RedHat/openafs-client.service
-+++ b/src/packaging/RedHat/openafs-client.service
-@@ -1,6 +1,7 @@
- [Unit]
- Description=OpenAFS Client Service
--After=syslog.target network.target
-+After=syslog.target network-online.target
-+Before=remote-fs.target
- 
- [Service]
- Type=forking
Index: /trunk/server/fedora/Makefile
===================================================================
--- /trunk/server/fedora/Makefile	(revision 2658)
+++ /trunk/server/fedora/Makefile	(revision 2659)
@@ -41,5 +41,5 @@
 
 dload		= ${PWD}/.dload
-openafs_url	= "https://www.openafs.org/dl/openafs/1.6.10/openafs-1.6.10-2.src.rpm"
+openafs_url	= "http://www.openafs.org/dl/openafs/candidate/1.6.11pre1/openafs-1.6.11-0.pre1.src.rpm"
 #zephyr_url	= "http://zephyr.1ts.org/files/zephyr-3.0.2.tar.gz"
 
Index: /trunk/server/fedora/specs/openafs.spec.patch
===================================================================
--- /trunk/server/fedora/specs/openafs.spec.patch	(revision 2658)
+++ /trunk/server/fedora/specs/openafs.spec.patch	(revision 2659)
@@ -2,13 +2,13 @@
 +++ openafs.spec	2014-05-25 21:16:27.836268275 -0400
 @@ -4,7 +4,7 @@
- %define pkgvers 1.6.10
+ %define pkgvers 1.6.11
  # for beta/rc releases make pkgrel 0.<tag>
  # for real releases make pkgrel 1 (or more for extra releases)
--%define pkgrel 2
-+%define pkgrel 2.99.scripts.%{scriptsversion}
+-%define pkgrel 0.pre1
++%define pkgrel 0.pre1.99.scripts.%{scriptsversion}
  
  %{!?fedorakmod: %define fedorakmod 1}
  %{!?build_dkmspkg: %define build_dkmspkg 1}
-@@ -249,9 +249,21 @@
+@@ -249,9 +249,18 @@
  %if %{build_modules}
  BuildRequires: kernel-devel
@@ -19,12 +19,9 @@
  
 +Patch1000: openafs-scripts.patch
-+Patch1002: openafs-systemd-crond.patch
 +Patch1003: openafs-systemd-csdb.patch
-+Patch1004: openafs-afs_lookup-return.patch
-+Patch1005: openafs-d_revalidate-mtpt.patch
-+Patch1006: openafs-linux-3.17.patch
 +Patch1007: openafs-mvid-NULL-deref.patch
 +Patch1008: openafs-afs_conn-overcounts.patch
 +Patch1009: openafs-d_splice_alias-reference.patch
++Patch1010: openafs-d_u.d_alias.patch
 +%define _default_patch_fuzz 2
 +
@@ -97,5 +94,5 @@
  %else
  
-@@ -698,6 +712,17 @@
+@@ -698,6 +712,14 @@
  #%setup -q -n %{srcdir}
  %setup -q -b 1 -n %{srcdir}
@@ -103,12 +100,9 @@
 +# Apply the Scripts patch
 +%patch1000 -p1 -b .scripts
-+%patch1002 -p1 -b .systemd-crond
 +%patch1003 -p1 -b .systemd-csdb
-+%patch1004 -p1 -b .afs_lookup-return
-+%patch1005 -p1 -b .d_revalidate-mtpt
-+%patch1006 -p1 -b .linux-3.17
 +%patch1007 -p1 -b .mvid-NULL-deref.patch
 +%patch1008 -p1 -b .afs_conn-overcounts.patch
 +%patch1009 -p1 -b .d_splice_alias-reference
++%patch1010 -p1 -b .d_u.d_alias
 +
  ##############################################################################
