source: trunk/server/common/patches/openafs-linux-3.17.patch @ 2639

Last change on this file since 2639 was 2639, checked in by andersk, 8 years ago
Add OpenAFS patches for Linux 3.17
File size: 4.7 KB
RevLine 
[2639]1From 75f36df74bb3c13aadb047163b93d6c24436f784 Mon Sep 17 00:00:00 2001
2From: Marc Dionne <marc.dionne@your-file-system.com>
3Date: Tue, 9 Sep 2014 10:39:55 -0300
4Subject: [PATCH 1/2] Linux 3.17: No more typedef for ctl_table
5
6The typedef has been removed so we need to use the structure
7directly.
8
9Note that the API for register_sysctl_table has also changed
10with 3.17, but it reverted back to a form that existed
11before and the configure tests handle it correctly.
12
13Reviewed-on: http://gerrit.openafs.org/11455
14Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
15Tested-by: BuildBot <buildbot@rampaginggeek.com>
16Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
17Reviewed-by: Andrew Deason <adeason@sinenomine.net>
18Reviewed-by: D Brashear <shadow@your-file-system.com>
19(cherry picked from commit 6a23ca5b6e8bcaf881be7a4c50bfba72d001e6cd)
20
21Change-Id: Ifb8fc0b9b01d2578c65407608f0e1b3f3b254459
22Reviewed-on: http://gerrit.openafs.org/11549
23Tested-by: BuildBot <buildbot@rampaginggeek.com>
24Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
25Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
26---
27 src/afs/LINUX/osi_sysctl.c | 4 ++--
28 src/cf/linux-test4.m4      | 2 +-
29 2 files changed, 3 insertions(+), 3 deletions(-)
30
31diff --git a/src/afs/LINUX/osi_sysctl.c b/src/afs/LINUX/osi_sysctl.c
32index a8f7fac..834e8ad 100644
33--- a/src/afs/LINUX/osi_sysctl.c
34+++ b/src/afs/LINUX/osi_sysctl.c
35@@ -34,7 +34,7 @@ extern afs_int32 afs_pct2;
36 #ifdef CONFIG_SYSCTL
37 static struct ctl_table_header *afs_sysctl = NULL;
38 
39-static ctl_table afs_sysctl_table[] = {
40+static struct ctl_table afs_sysctl_table[] = {
41     {
42 #if defined(STRUCT_CTL_TABLE_HAS_CTL_NAME)
43 #if defined(CTL_UNNUMBERED)
44@@ -234,7 +234,7 @@ static ctl_table afs_sysctl_table[] = {
45     {0}
46 };
47 
48-static ctl_table fs_sysctl_table[] = {
49+static struct ctl_table fs_sysctl_table[] = {
50     {
51 #if defined(STRUCT_CTL_TABLE_HAS_CTL_NAME)
52 #if defined(CTL_UNNUMBERED)
53diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4
54index b068af5..1759d9e 100644
55--- a/src/cf/linux-test4.m4
56+++ b/src/cf/linux-test4.m4
57@@ -395,7 +395,7 @@ AC_DEFUN([LINUX_REGISTER_SYSCTL_TABLE_NOFLAG], [
58   AC_CHECK_LINUX_BUILD([whether register_sysctl_table has an insert_at_head argument],
59                       [ac_cv_linux_register_sysctl_table_noflag],
60                       [#include <linux/sysctl.h>],
61-                      [ctl_table *t; register_sysctl_table (t);],
62+                      [struct ctl_table *t; register_sysctl_table (t);],
63                       [REGISTER_SYSCTL_TABLE_NOFLAG],
64                       [define if register_sysctl_table has no insert_at head flag],
65                       [])
66--
672.2.0.rc1
68
69From 663bdfcb16ab742ef12acca110f279b749f15586 Mon Sep 17 00:00:00 2001
70From: Marc Dionne <marc.dionne@your-file-system.com>
71Date: Thu, 25 Sep 2014 07:52:12 -0300
72Subject: [PATCH 2/2] Linux 3.17: Deal with d_splice_alias errors
73
74In 3.17 the logic in d_splice_alias has changed.  Of interest to
75us is the fact that it will now return an EIO error if it finds
76an existing connected directory for the dentry, where it would
77previously have added a new alias for it.  As a result the end
78user can get EIO errors when accessing any file in a volume
79if the volume was first accessed through a different path (ex:
80RO path vs RW path).
81
82This commit just restores the old behaviour, adding the directory
83alias manually in the error case, which is what older versions
84of d_splice_alias used to do.
85
86Reviewed-on: http://gerrit.openafs.org/11492
87Tested-by: BuildBot <buildbot@rampaginggeek.com>
88Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
89Reviewed-by: Andrew Deason <adeason@sinenomine.net>
90Reviewed-by: D Brashear <shadow@your-file-system.com>
91(cherry picked from commit 5815ee92a41cdcf105741d834042a5617dc4c219)
92
93Change-Id: Ie86009ede93255c85fcf640af14c598fe1e42ca9
94Reviewed-on: http://gerrit.openafs.org/11550
95Tested-by: BuildBot <buildbot@rampaginggeek.com>
96Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
97Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
98---
99 src/afs/LINUX/osi_vnodeops.c | 15 ++++++++++++---
100 1 file changed, 12 insertions(+), 3 deletions(-)
101
102diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c
103index 7e5cdd1..3ddcf42 100644
104--- a/src/afs/LINUX/osi_vnodeops.c
105+++ b/src/afs/LINUX/osi_vnodeops.c
106@@ -1529,9 +1529,18 @@ afs_linux_lookup(struct inode *dip, struct dentry *dp)
107     /* It's ok for the file to not be found. That's noted by the caller by
108      * seeing that the dp->d_inode field is NULL.
109      */
110-    if (!code || code == ENOENT)
111-       return newdp;
112-    else
113+    if (!code || code == ENOENT) {
114+       /*
115+        * d_splice_alias can return an error (EIO) if there is an existing
116+        * connected directory alias for this dentry.
117+        */
118+       if (!IS_ERR(newdp))
119+           return newdp;
120+       else {
121+           d_add(dp, ip);
122+           return NULL;
123+       }
124+    } else
125        return ERR_PTR(afs_convert_code(code));
126 }
127 
128--
1292.2.0.rc1
130
Note: See TracBrowser for help on using the repository browser.