SHA256
1
0
forked from pool/openafs

Accepting request 666535 from home:hauky:branches:filesystems_GA

- Fix build for Lunux-4.20: Linux-4.20.patch
- use proper log-directory: dir_layout.patch

OBS-URL: https://build.opensuse.org/request/show/666535
OBS-URL: https://build.opensuse.org/package/show/filesystems/openafs?expand=0&rev=32
This commit is contained in:
Christof Hanke 2019-01-21 16:15:53 +00:00 committed by Git OBS Bridge
parent 58e3df498f
commit 76b05411fa
4 changed files with 148 additions and 2 deletions

123
Linux-4.20.patch Normal file
View File

@ -0,0 +1,123 @@
commit 3c454b39d04f4886536267c211171dae30dc0344
Author: Mark Vitale <mvitale@sinenomine.net>
Date: Tue Nov 13 11:20:09 2018 -0500
Linux 4.20: current_kernel_time is gone
With Linux commit 976516404ff3fab2a8caa8bd6f5efc1437fed0b8 'y2038:
remove unused time interfaces' (4.20-rc1), current_kernel_time() has
been removed.
Many y2038-compliant time APIs were introduced with Linux commit
fb7fcc96a86cfaef0f6dcc0665516aa68611e736 'timekeeping: Standardize on
ktime_get_*() naming' (4.18). According to
Documentation/core-api/timekeeping.rst, a suitable replacement for:
struct timespec current_kernel_time(void)
would be:
void ktime_get_coarse_real_ts64(struct timespec64 *ts))
Add an autoconf test and equivalent logic to deal.
Change-Id: I4ff622ad40cc6d398267276d13493d819b877350
Reviewed-on: https://gerrit.openafs.org/13391
Tested-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
diff --git a/src/afs/LINUX/osi_machdep.h b/src/afs/LINUX/osi_machdep.h
index ce8cabf6e..a1a2f57c0 100644
--- a/src/afs/LINUX/osi_machdep.h
+++ b/src/afs/LINUX/osi_machdep.h
@@ -75,7 +75,14 @@
#if defined(HAVE_LINUX_CRED_H)
#include "h/cred.h"
#endif
-#if defined(HAVE_LINUX_CURRENT_KERNEL_TIME)
+
+#if defined(HAVE_LINUX_KTIME_GET_COARSE_REAL_TS64)
+static inline time_t osi_Time(void) {
+ struct timespec64 xtime;
+ ktime_get_coarse_real_ts64(&xtime);
+ return xtime.tv_sec;
+}
+#elif defined(HAVE_LINUX_CURRENT_KERNEL_TIME)
static inline time_t osi_Time(void) {
struct timespec xtime;
xtime = current_kernel_time();
diff --git a/src/cf/linux-kernel-func.m4 b/src/cf/linux-kernel-func.m4
index 0b17e172e..62fd528d6 100644
--- a/src/cf/linux-kernel-func.m4
+++ b/src/cf/linux-kernel-func.m4
@@ -72,6 +72,10 @@ AC_CHECK_LINUX_FUNC([iter_file_splice_write],
AC_CHECK_LINUX_FUNC([kernel_setsockopt],
[#include <linux/net.h>],
[kernel_setsockopt(NULL, 0, 0, NULL, 0);])
+AC_CHECK_LINUX_FUNC([ktime_get_coarse_real_ts64],
+ [#include <linux/time.h>],
+ [struct timespec64 *s;
+ ktime_get_coarse_real_ts64(s);])
AC_CHECK_LINUX_FUNC([locks_lock_file_wait],
[#include <linux/fs.h>],
[locks_lock_file_wait(NULL, NULL);])
commit aa80f892ec39e2984818090a6bb2047430836ee2
Author: Mark Vitale <mvitale@sinenomine.net>
Date: Thu Nov 15 15:31:37 2018 -0500
Linux 4.20: do_settimeofday is gone
With Linux commit 976516404ff3fab2a8caa8bd6f5efc1437fed0b8 'y2038:
remove unused time interfaces', do_settimeofday() is gone.
However, OpenAFS only calls do_settimeofday() from afs_osi_SetTime(),
which has been dead code since -settime support was removed from afsd
with commit 1d9888be486198868983048eeffabdfef5afa94b 'Remove
-settime/RXAFS_GetTime client support'.
Instead of fixing afs_osi_SetTime() to use a current Linux API, remove
it as dead code.
No functional change is incurred by this commit. However, this change
is required in order to build OpenAFS on Linux 4.20.
Change-Id: I74913deb249de66b0da71539f2596c971f0fd99a
Reviewed-on: https://gerrit.openafs.org/13392
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
diff --git a/src/afs/LINUX/osi_misc.c b/src/afs/LINUX/osi_misc.c
index 077d4edfb..655076779 100644
--- a/src/afs/LINUX/osi_misc.c
+++ b/src/afs/LINUX/osi_misc.c
@@ -28,18 +28,6 @@
int afs_osicred_initialized = 0;
afs_ucred_t afs_osi_cred;
-void
-afs_osi_SetTime(osi_timeval_t * tvp)
-{
- struct timespec tv;
- tv.tv_sec = tvp->tv_sec;
- tv.tv_nsec = tvp->tv_usec * NSEC_PER_USEC;
-
- AFS_STATCNT(osi_SetTime);
-
- do_settimeofday(&tv);
-}
-
void
osi_linux_mask(void)
{
diff --git a/src/afs/LINUX/osi_prototypes.h b/src/afs/LINUX/osi_prototypes.h
index 438b07789..130b5660e 100644
--- a/src/afs/LINUX/osi_prototypes.h
+++ b/src/afs/LINUX/osi_prototypes.h
@@ -44,7 +44,6 @@ extern void osi_ioctl_init(void);
extern void osi_ioctl_clean(void);
/* osi_misc.c */
-extern void afs_osi_SetTime(osi_timeval_t * tvp);
extern int osi_lookupname_internal(char *aname, int followlink,
struct vfsmount **mnt, struct dentry **dpp);
extern int osi_lookupname(char *aname, uio_seg_t seg, int followlink,

11
dir_layout.patch Normal file
View File

@ -0,0 +1,11 @@
--- openafs-1.8.2/src/cf/dirpaths.m4.orig 2019-01-16 11:16:56.160768067 +0100
+++ openafs-1.8.2/src/cf/dirpaths.m4 2019-01-16 11:17:49.300846193 +0100
@@ -21,7 +21,7 @@
afssrvsbindir=${afssrvsbindir='${sbindir}'}
afssrvlibexecdir=${afssrvlibexecdir='${libexecdir}/openafs'}
afsdbdir=${afsdbdir='${localstatedir}/openafs/db'}
- afslogsdir=${afslogsdir='${localstatedir}/openafs/logs'}
+ afslogsdir=${afslogsdir='/var/log/openafs'}
afslocaldir=${afslocaldir='${localstatedir}/openafs'}
afsbackupdir=${afsbackupdir='${localstatedir}/openafs/backup'}
afsbosconfigdir=${afsbosconfigdir='${sysconfdir}/openafs'}

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Jan 16 11:28:27 UTC 2019 - christof.hanke@mpcdf.mpg.de
- Fix build for Lunux-4.20: Linux-4.20.patch
- use proper log-directory: dir_layout.patch
-------------------------------------------------------------------
Fri Sep 28 12:47:02 UTC 2018 - Guillaume GARDET <guillaume.gardet@opensuse.org>

View File

@ -1,7 +1,7 @@
#
# spec file for package openafs
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -12,7 +12,7 @@
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# needssslcertforbuild
@ -92,10 +92,14 @@ Source56: openafs.CellAlias
Source57: openafs.ThisCell
Source58: openafs.cacheinfo
Source99: openafs.changes
# PATCH-SUSE-SPECIFIC use proper directory layout
Patch3: dir_layout.patch
# PATCH-FIX-UPSTREAM make configure detect ncurses 6 correctly
Patch4: openafs-1.8.x.ncurses6.patch
# PATCH-SUSE-SPECIFIC make KMP work again
Patch5: add_arch_to_linux_kernel_make.patch
# PATCH-BACKPORT-FROM-UPSTREAM make KMP build for kernel 4.20
Patch6: Linux-4.20.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
#
@ -303,7 +307,9 @@ for src_file in %{S:0} %{S:1}; do
done
%setup -q -n openafs-%{upstream_version} -T -b 0 -b 1
%patch3 -p1
%patch5 -p1
%patch6 -p1
%if %{run_regen}
%patch4 -p1