]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
LINUX: Debian/Ubuntu build regression on kernel 3.16.39
authorSergio Gelato <Sergio.Gelato@astro.su.se>
Wed, 22 Feb 2017 21:55:33 +0000 (13:55 -0800)
committerStephan Wiesand <stephan.wiesand@desy.de>
Wed, 8 Mar 2017 08:58:08 +0000 (03:58 -0500)
Now that kernel 4.9 has hit jessie-backports, it becomes desirable to
also backport the associated openafs patches.

Unfortunately, Linux-4.9-inode_change_ok-becomes-setattr_prepare.patch
causes a build failure against jessie's current default kernel,
3.16.39-1, due to the fact that setattr_prepare() is available (it was
cherrypicked to address CVE-2015-1350) but file_dentry() is not (it was
introduced in kernel 4.6).

This makes it difficult to have a version of openafs for jessie that
supports both kernels.

To deal with this, follow the implementation of file_dentry() in 4.6,
and simplify it to account for the lack of d_real() support in older
kernels.

Note that inode_change_ok() has been added back to 3.16.39-1 to avoid
ABI changes. That means the current openafs packages in jessie continue
to work with kernel 3.16.39-1 since they do not include
Linux-4.9-inode_change_ok-becomes-setattr_prepare.patch.

Originally reported at
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=855366

FIXES RT134158

Reviewed-on: https://gerrit.openafs.org/12523
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 6ea6c182c7fb6c22dafbbf203abcc23726e06cba)

Change-Id: I06951dacef3f7639f749e82439df89ec3d78b592
Reviewed-on: https://gerrit.openafs.org/12535
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
acinclude.m4
src/afs/LINUX/osi_compat.h

index bcf8ecf48f31333f152f2fe95e4ff2a45a3690a7..6d34609ed7b2c7135cc247fe7c072cc37c1f3516 100644 (file)
@@ -973,6 +973,9 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                 AC_CHECK_LINUX_FUNC([do_sync_read],
                                     [#include <linux/fs.h>],
                                     [do_sync_read(NULL, NULL, 0, NULL);])
+                AC_CHECK_LINUX_FUNC([file_dentry],
+                                    [#include <linux/fs.h>],
+                                    [struct file *f; file_dentry(f);])
                 AC_CHECK_LINUX_FUNC([find_task_by_pid],
                                     [#include <linux/sched.h>],
                                     [pid_t p; find_task_by_pid(p);])
index a25fd2ee4a80b488541199d865d3b6e95a0bbd78..8e72161bf4beedccf6d66198f12ca18a81d5efca 100644 (file)
@@ -47,6 +47,10 @@ typedef struct path afs_linux_path_t;
 # endif
 #endif
 
+#ifndef HAVE_LINUX_FILE_DENTRY
+#define file_dentry(file) ((file)->f_dentry)
+#endif
+
 #if defined(HAVE_LINUX_LOCKS_LOCK_FILE_WAIT)
 # define flock_lock_file_wait locks_lock_file_wait
 #endif