1 From: Benjamin Kaduk <kaduk@mit.edu>
2 Date: Thu, 14 Dec 2017 19:54:57 -0600
3 Subject: Fix macro used to check kernel_read() argument order
5 The m4 macro implementing the configure check is called
6 LINUX_KERNEL_READ_OFFSET_IS_LAST, but it defines a preprocessor symbol
7 that is just KERNEL_READ_OFFSET_IS_LAST. Our code needs to check
8 for the latter being defined, not the former.
10 Reported by Aaron Ucko.
12 Change-Id: Id7cd3245b6a8eb05f83c03faee9c15bab8d0f6e8
13 Reviewed-on: https://gerrit.openafs.org/12808
14 Reviewed-by: Anders Kaseorg <andersk@mit.edu>
15 Tested-by: BuildBot <buildbot@rampaginggeek.com>
16 Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
17 (cherry picked from commit edc5463f3db4b6af2307741d9f4ee8f2c81cd98e)
19 src/afs/LINUX/osi_compat.h | 4 ++--
20 1 file changed, 2 insertions(+), 2 deletions(-)
22 diff --git a/src/afs/LINUX/osi_compat.h b/src/afs/LINUX/osi_compat.h
23 index 78be496..17a61cf 100644
24 --- a/src/afs/LINUX/osi_compat.h
25 +++ b/src/afs/LINUX/osi_compat.h
26 @@ -606,7 +606,7 @@ afs_file_read(struct file *filp, char __user *buf, size_t len, loff_t *pos)
27 #if defined(HAVE_LINUX___VFS_WRITE)
28 return __vfs_read(filp, buf, len, pos);
29 #elif defined(HAVE_LINUX_KERNEL_WRITE)
30 -# if defined(LINUX_KERNEL_READ_OFFSET_IS_LAST)
31 +# if defined(KERNEL_READ_OFFSET_IS_LAST)
32 return kernel_read(filp, buf, len, pos);
34 return kernel_read(filp, *pos, buf, len);
35 @@ -622,7 +622,7 @@ afs_file_write(struct file *filp, char __user *buf, size_t len, loff_t *pos)
36 #if defined(HAVE_LINUX___VFS_WRITE)
37 return __vfs_write(filp, buf, len, pos);
38 #elif defined(HAVE_LINUX_KERNEL_WRITE)
39 -# if defined(LINUX_KERNEL_READ_OFFSET_IS_LAST)
40 +# if defined(KERNEL_READ_OFFSET_IS_LAST)
41 return kernel_write(filp, buf, len, pos);
43 return kernel_write(filp, buf, len, *pos);