From 1f284665fa0fd944d331d844f3e3a10ef351a876 Mon Sep 17 00:00:00 2001 From: Domen Kožar Date: Thu, 9 Oct 2014 13:12:29 +0200 Subject: add patches for openafs-client on kerel 3.17 --- ...I5558c64760e4cad2bd3dc648067d81020afc69b6.patch | 48 +++++++++++++++++++ ...If1fd9d27f795dee4b5aa2152dd09e0540d643a69.patch | 55 ++++++++++++++++++++++ pkgs/servers/openafs-client/default.nix | 2 + 3 files changed, 105 insertions(+) create mode 100644 pkgs/servers/openafs-client/I5558c64760e4cad2bd3dc648067d81020afc69b6.patch create mode 100644 pkgs/servers/openafs-client/If1fd9d27f795dee4b5aa2152dd09e0540d643a69.patch (limited to 'pkgs/servers') diff --git a/pkgs/servers/openafs-client/I5558c64760e4cad2bd3dc648067d81020afc69b6.patch b/pkgs/servers/openafs-client/I5558c64760e4cad2bd3dc648067d81020afc69b6.patch new file mode 100644 index 000000000000..d8f922aba374 --- /dev/null +++ b/pkgs/servers/openafs-client/I5558c64760e4cad2bd3dc648067d81020afc69b6.patch @@ -0,0 +1,48 @@ +From: Marc Dionne +Date: Thu, 25 Sep 2014 10:52:12 +0000 (-0300) +Subject: Linux 3.17: Deal with d_splice_alias errors +X-Git-Url: http://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=af7f1d59135526ea584a4403b6400106dc92a992;hp=880401913d6190054bb0511093606a206b16326c + +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. + +Change-Id: I5558c64760e4cad2bd3dc648067d81020afc69b6 +--- + +diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c +index e03187f..0cdd9e0 100644 +--- a/src/afs/LINUX/osi_vnodeops.c ++++ b/src/afs/LINUX/osi_vnodeops.c +@@ -1593,9 +1593,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)); + } + diff --git a/pkgs/servers/openafs-client/If1fd9d27f795dee4b5aa2152dd09e0540d643a69.patch b/pkgs/servers/openafs-client/If1fd9d27f795dee4b5aa2152dd09e0540d643a69.patch new file mode 100644 index 000000000000..f8844915f85c --- /dev/null +++ b/pkgs/servers/openafs-client/If1fd9d27f795dee4b5aa2152dd09e0540d643a69.patch @@ -0,0 +1,55 @@ +From 880401913d6190054bb0511093606a206b16326c Mon Sep 17 00:00:00 2001 +From: Marc Dionne +Date: Tue, 9 Sep 2014 10:39:55 -0300 +Subject: [PATCH] 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. + +Change-Id: If1fd9d27f795dee4b5aa2152dd09e0540d643a69 +--- + 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 dad91d9..228b491 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 ], +- [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], + []) +-- +1.7.1 diff --git a/pkgs/servers/openafs-client/default.nix b/pkgs/servers/openafs-client/default.nix index 4b5eb80b9741..4f4ec5cbc069 100644 --- a/pkgs/servers/openafs-client/default.nix +++ b/pkgs/servers/openafs-client/default.nix @@ -14,6 +14,8 @@ stdenv.mkDerivation { patches = [ ./f3c0f74186f4a323ffc5f125d961fe384d396cac.patch ./ae86b07f827d6f3e2032a412f5f6cb3951a27d2d.patch + ./I5558c64760e4cad2bd3dc648067d81020afc69b6.patch + ./If1fd9d27f795dee4b5aa2152dd09e0540d643a69.patch ]; buildInputs = [ autoconf automake flex yacc ncurses perl which ]; -- cgit 1.4.1