Package: openafs
Version: 1.6.10-3
Severity: important
Tags: patch
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu vivid ubuntu-patch

Dear Maintainer,

In Ubuntu we are about to switch up to a v3.18 based kernel.  It seems
there are a trio of incompatibilities exposed there for the DKMS module.
They all seem pretty safely fixed, and we have just uploaded that to
Ubuntu for testing.

In Ubuntu, the attached patch was applied to achieve the following:

  * Upstream v3.18 porting (LP: #1397275):
   - follow removal of key_type match op
   - follow removal of ctl_table typedef
   - d_invalidate now returns void


Thanks for considering these patches for Debian.

-apw

-- System Information:
Debian Release: jessie/sid
  APT prefers vivid-updates
  APT policy: (500, 'vivid-updates'), (500, 'vivid-security'), (500, 'vivid'), 
(100, 'vivid-backports')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.18.0-4-generic (SMP w/4 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
diff -Nru openafs-1.6.10/debian/changelog openafs-1.6.10/debian/changelog
diff -Nru openafs-1.6.10/debian/patches/series openafs-1.6.10/debian/patches/series
--- openafs-1.6.10/debian/patches/series	2014-11-06 20:06:47.000000000 +0000
+++ openafs-1.6.10/debian/patches/series	2014-11-27 21:21:32.000000000 +0000
@@ -1,3 +1,6 @@
 0001-userok.c-Fix-fixed-size-on-stack-path-buffers.patch
 0002-Tweak-AFSDIR_PATH_MAX-definition.patch
 0003-Add-dummy-exit-command-for-afsd-to-do-nothing.patch
+ubuntu-v3.18-key_type-removes-match.patch
+ubuntu-v3.18-typedef-ctl_table-removed.patch
+ubuntu-v3.18-d_invalidate-returns-void.patch
diff -Nru openafs-1.6.10/debian/patches/ubuntu-v3.18-d_invalidate-returns-void.patch openafs-1.6.10/debian/patches/ubuntu-v3.18-d_invalidate-returns-void.patch
--- openafs-1.6.10/debian/patches/ubuntu-v3.18-d_invalidate-returns-void.patch	1970-01-01 01:00:00.000000000 +0100
+++ openafs-1.6.10/debian/patches/ubuntu-v3.18-d_invalidate-returns-void.patch	2014-11-27 21:42:33.000000000 +0000
@@ -0,0 +1,61 @@
+Description: v3.18 porting -- d_invalidate now returns void
+ In v3.18 they have changed d_invalidate to return void as it can no
+ longer fail.  Comment out the recovery code as it is no longer needed.
+Author: Andy Whitcroft <a...@ubuntu.com>
+---
+
+--- openafs-1.6.10.orig/src/afs/LINUX/osi_vcache.c
++++ openafs-1.6.10/src/afs/LINUX/osi_vcache.c
+@@ -39,11 +39,15 @@ restart:
+ 	    dget_locked(dentry);
+ 
+ 	    spin_unlock(&dcache_lock);
++#if defined(D_INVALIDATE_NOT_VOID)
+ 	    if (d_invalidate(dentry) == -EBUSY) {
+ 		dput(dentry);
+ 		/* perhaps lock and try to continue? (use cur as head?) */
+ 		goto inuse;
+ 	    }
++#else
++	    d_invalidate(dentry);
++#endif
+ 	    dput(dentry);
+ 	    spin_lock(&dcache_lock);
+ 	    goto restart;
+@@ -71,11 +75,15 @@ restart:
+ 	    dget(dentry);
+ 
+ 	    spin_unlock(&inode->i_lock);
++#if defined(D_INVALIDATE_NOT_VOID)
+ 	    if (d_invalidate(dentry) == -EBUSY) {
+ 		dput(dentry);
+ 		/* perhaps lock and try to continue? (use cur as head?) */
+ 		goto inuse;
+ 	    }
++#else
++	    d_invalidate(dentry);
++#endif
+ 	    dput(dentry);
+ 	    spin_lock(&inode->i_lock);
+ 	    goto restart;
+--- openafs-1.6.10.orig/src/cf/linux-test4.m4
++++ openafs-1.6.10/src/cf/linux-test4.m4
+@@ -182,6 +182,18 @@ AC_DEFUN([LINUX_INODE_SETATTR_RETURN_TYP
+ ])
+ 
+ 
++AC_DEFUN([LINUX_D_INVALIDATE_RETURN_TYPE], [
++  AC_CHECK_LINUX_BUILD([for d_invalidate return type],
++		       [ac_cv_linux_func_d_invalidater_returns_int],
++		       [#include <linux/dentry.h>],
++		       [struct dentry _dentry;
++			int i;
++			i = d_invalidate(&_dentry);],
++		       [D_INVALIDATE_NOT_VOID],
++		       [define if your d_invalidate return return non-void],
++		       [])
++])
++
+ 
+ AC_DEFUN([LINUX_AOP_WRITEBACK_CONTROL], [
+   AC_CHECK_LINUX_BUILD([whether aop.writepage takes a writeback_control],
diff -Nru openafs-1.6.10/debian/patches/ubuntu-v3.18-key_type-removes-match.patch openafs-1.6.10/debian/patches/ubuntu-v3.18-key_type-removes-match.patch
--- openafs-1.6.10/debian/patches/ubuntu-v3.18-key_type-removes-match.patch	1970-01-01 01:00:00.000000000 +0100
+++ openafs-1.6.10/debian/patches/ubuntu-v3.18-key_type-removes-match.patch	2014-11-27 21:42:13.000000000 +0000
@@ -0,0 +1,46 @@
+Description: v3.18 porting -- follow removal of key_type match op
+ In v3.18 they have removed the key_type match op.  This now defaults to
+ a direct match.  As this is what the afs match does we can simply stop
+ supplying our match.
+Author: Andy Whitcroft <a...@ubuntu.com>
+---
+
+Index: openafs-1.6.10/acinclude.m4
+===================================================================
+--- openafs-1.6.10.orig/acinclude.m4
++++ openafs-1.6.10/acinclude.m4
+@@ -842,6 +842,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinu
+ 		 AC_CHECK_LINUX_STRUCT([inode_operations], [truncate], [fs.h])
+ 		 AC_CHECK_LINUX_STRUCT([key_type], [preparse], [key-type.h])
+ 		 AC_CHECK_LINUX_STRUCT([key_type], [instantiate_prep], [key-type.h])
++		 AC_CHECK_LINUX_STRUCT([key_type], [match], [key-type.h])
+ 		 AC_CHECK_LINUX_STRUCT([nameidata], [path], [namei.h])
+ 		 AC_CHECK_LINUX_STRUCT([proc_dir_entry], [owner], [proc_fs.h])
+ 		 AC_CHECK_LINUX_STRUCT([super_block], [s_bdi], [fs.h])
+Index: openafs-1.6.10/src/afs/LINUX/osi_groups.c
+===================================================================
+--- openafs-1.6.10.orig/src/afs/LINUX/osi_groups.c
++++ openafs-1.6.10/src/afs/LINUX/osi_groups.c
+@@ -498,10 +498,12 @@ error:
+     return code;
+ }
+ 
++#if defined(STRUCT_KEY_TYPE_HAS_MATCH)
+ static int afs_pag_match(const struct key *key, const void *description)
+ {
+ 	return strcmp(key->description, description) == 0;
+ }
++#endif
+ 
+ static void afs_pag_destroy(struct key *key)
+ {
+@@ -527,7 +529,9 @@ struct key_type key_type_afs_pag =
+ #else
+     .instantiate = afs_pag_instantiate,
+ #endif
++#if defined(STRUCT_KEY_TYPE_HAS_MATCH)
+     .match       = afs_pag_match,
++#endif
+     .destroy     = afs_pag_destroy,
+ };
+ 
diff -Nru openafs-1.6.10/debian/patches/ubuntu-v3.18-typedef-ctl_table-removed.patch openafs-1.6.10/debian/patches/ubuntu-v3.18-typedef-ctl_table-removed.patch
--- openafs-1.6.10/debian/patches/ubuntu-v3.18-typedef-ctl_table-removed.patch	1970-01-01 01:00:00.000000000 +0100
+++ openafs-1.6.10/debian/patches/ubuntu-v3.18-typedef-ctl_table-removed.patch	2014-11-27 18:06:17.000000000 +0000
@@ -0,0 +1,41 @@
+Description: v3.18 porting -- follow removal of ctl_table typedef
+ In v3.18 they have removed the ctl_table typedef, existing code has all
+ been converted to use struct ctl_table.  Do the same here, as this is the
+ type from inception we do not need to make this change conditional.
+Author: Andy Whitcroft <a...@ubuntu.com>
+
+Index: openafs-1.6.10/src/afs/LINUX/osi_sysctl.c
+===================================================================
+--- openafs-1.6.10.orig/src/afs/LINUX/osi_sysctl.c
++++ openafs-1.6.10/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)
+Index: openafs-1.6.10/src/cf/linux-test4.m4
+===================================================================
+--- openafs-1.6.10.orig/src/cf/linux-test4.m4
++++ openafs-1.6.10/src/cf/linux-test4.m4
+@@ -395,7 +395,7 @@ AC_DEFUN([LINUX_REGISTER_SYSCTL_TABLE_NO
+   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],
+ 		       [])

Reply via email to