Accepting request 1126553 from filesystems

OBS-URL: https://build.opensuse.org/request/show/1126553
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/openafs?expand=0&rev=44
This commit is contained in:
Ana Guerrero 2023-11-15 20:08:56 +00:00 committed by Git OBS Bridge
commit 2fdb6138ed
6 changed files with 266 additions and 6 deletions

84
4f1d810.diff Normal file
View File

@ -0,0 +1,84 @@
From 4f1d8104d17d2b4e95c7abaf5498db6b80aefa8f Mon Sep 17 00:00:00 2001
From: Cheyenne Wills <cwills@sinenomine.net>
Date: Mon, 18 Sep 2023 12:23:01 -0600
Subject: [PATCH] Linux 6.6: Pass request_mask to generic_fillattr
The Linux 6.6 commit: "fs: pass the request_mask to generic_fillattr"
(0d72b92883) added an additional parameter to Linux's
generic_fillattr() function.
For openafs, generic_fillattr() is called from the inode_operations
method "getattr", which is implemented in afs_linux_getattr(). The value
for the request_mask parameter is an existing parameter that is passed
to the inode_operations "getattr" method.
Add an autoconf test for 4 parameters to the generic_fillattr function
and update afs_linux_getattr() to pass the request_mask to
generic_fillattr().
Reviewed-on: https://gerrit.openafs.org/15561
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Kailas Zadbuke <kailashsz@in.ibm.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 4fed232b80fb1ad6c0e1dfb42ed8d8e1e6821dd7)
Change-Id: I5cddc56c5e605a6c5e4f7f3691eafec8ca589d2c
Reviewed-on: https://gerrit.openafs.org/15590
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
---
diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c
index 932fd9d..d5fab97 100644
--- a/src/afs/LINUX/osi_vnodeops.c
+++ b/src/afs/LINUX/osi_vnodeops.c
@@ -1195,7 +1195,11 @@
{
int err = afs_linux_revalidate(path->dentry);
if (!err) {
+# if defined(GENERIC_FILLATTR_TAKES_REQUEST_MASK)
+ generic_fillattr(afs_mnt_idmap, request_mask, path->dentry->d_inode, stat);
+# else
generic_fillattr(afs_mnt_idmap, path->dentry->d_inode, stat);
+# endif
}
return err;
}
diff --git a/src/cf/linux-kernel-assorted.m4 b/src/cf/linux-kernel-assorted.m4
index b3a11bc..49827d5 100644
--- a/src/cf/linux-kernel-assorted.m4
+++ b/src/cf/linux-kernel-assorted.m4
@@ -58,6 +58,7 @@
LINUX_D_INVALIDATE_IS_VOID
LINUX_KERNEL_READ_OFFSET_IS_LAST
LINUX_KEYRING_SEARCH_TAKES_RECURSE
+LINUX_GENERIC_FILLATTR_TAKES_REQUEST_MASK
])
diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4
index 1e4dcaf..3596b6a 100644
--- a/src/cf/linux-test4.m4
+++ b/src/cf/linux-test4.m4
@@ -854,3 +854,16 @@
[define if your keyring_search has the recurse parameter],
[])
])
+
+dnl Linux 6.6 added the 'request_mask' parameter to generic_fillattr.
+AC_DEFUN([LINUX_GENERIC_FILLATTR_TAKES_REQUEST_MASK], [
+ AC_CHECK_LINUX_BUILD([whether generic_fillattr has the request_mask parameter],
+ [ac_cv_linux_func_generic_fillattr_takes_request_mask],
+ [#include <linux/fs.h>],
+ [
+ generic_fillattr(NULL, 0, NULL, NULL);
+ ],
+ [GENERIC_FILLATTR_TAKES_REQUEST_MASK],
+ [define if your generic_fillattr has the request_mask_parameter],
+ [])
+])

55
5b647bf.diff Normal file
View File

@ -0,0 +1,55 @@
From 5b647bf17a878271e1ce9882e41663770ee73528 Mon Sep 17 00:00:00 2001
From: Cheyenne Wills <cwills@sinenomine.net>
Date: Wed, 06 Sep 2023 11:41:55 -0600
Subject: [PATCH] LINUX: Pass an array of structs to register_sysctl
The Linux 6.6 commit "sysctl: Add size to register_sysctl" (9edbfe92a0)
renamed the Linux function register_sysctl() to register_sysctl_sz() and
added a size parameter. For backward compatibility, a macro,
register_sysctl, is provided. The macro calculates the size of the
ctl_table being registered and passes the size to register_sysctl_sz.
However, in order to perform the size calculation, an array of ctl_table
structures must be passed as the 2nd parameter.
This change only affects the autoconf test used to determine if Linux
provides register_sysctl.
Update the autoconf test for register_sysctl to use an actual ctl_table
structure for the 2nd parameter instead of a NULL.
Reviewed-on: https://gerrit.openafs.org/15559
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 76879b28798840fa0df441c328ada9667f06b154)
Change-Id: I9209d9fbc4514ab658f373510decfc2e81a5dc5f
Reviewed-on: https://gerrit.openafs.org/15575
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
---
diff --git a/src/cf/linux-kernel-func.m4 b/src/cf/linux-kernel-func.m4
index 8119549..b913676 100644
--- a/src/cf/linux-kernel-func.m4
+++ b/src/cf/linux-kernel-func.m4
@@ -220,10 +220,13 @@
dnl Linux 6.5 removed the Linux function register_sysctl_table(), which
dnl was deprecated in Linux 6.3 in favor of register_sysctl() which was
dnl introduced in Linux 3.3
+dnl Linux 6.6 changed the function register_sysctl to a macro that requires
+dnl an array of ctl_table structures as its 2nd parameter
AC_CHECK_LINUX_FUNC([register_sysctl],
- [#include <linux/kernel.h>
- #include <linux/sysctl.h>],
- [(void)register_sysctl(NULL, NULL);])
+ [#include <linux/kernel.h>
+ #include <linux/sysctl.h>],
+ [[static struct ctl_table cf_sysctl_table[1];
+ (void)register_sysctl(NULL, cf_sysctl_table);]])
dnl Consequences - things which get set as a result of the
dnl above tests

97
6413fdb.diff Normal file
View File

@ -0,0 +1,97 @@
From 6413fdbc913834f2884989e5811841f4ccea2b5f Mon Sep 17 00:00:00 2001
From: Cheyenne Wills <cwills@sinenomine.net>
Date: Thu, 05 Oct 2023 14:44:49 -0600
Subject: [PATCH] Linux 6.6: convert to ctime accessor functions
The Linux 6.6 commit "fs: add ctime accessors infrastructure"
(9b6304c1d5) added accessor functions for an inode's ctime member.
A follow on commit "fs: rename i_ctime field to __i_ctime" (13bc244578)
changed the name of the inode member ctime to __i_ctime to indicate it's
a private member.
Add an autoconf test for the ctime accessor function
'inode_set_ctime()'.
Add an afs_inode_set_ctime to LINUX/osi_machdep.h that is either defined
as a macro to Linux's inode_set_ctime, or implements a static inline
function to set a inode's ctime.
Convert the setting of an inode's ctime to use afs_inode_set_ctime().
For more information behind the Linux change, see the commit message
for:
"Merge tag 'v6.6-vfs.ctime'
of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs" (615e95831)
Reviewed-on: https://gerrit.openafs.org/15560
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 072c7934cd1b99052882f02294f7036d422b6cf1)
Conflicts:
src/cf/linux-kernel-func.m4 (context)
Change-Id: I729408d12a7946f5778b036ca7e2c14299f3ce8e
Reviewed-on: https://gerrit.openafs.org/15589
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
---
diff --git a/src/afs/LINUX/osi_machdep.h b/src/afs/LINUX/osi_machdep.h
index 2220e05..f9ceb35 100644
--- a/src/afs/LINUX/osi_machdep.h
+++ b/src/afs/LINUX/osi_machdep.h
@@ -118,6 +118,17 @@
}
#endif
+#if defined(HAVE_LINUX_INODE_SET_CTIME)
+# define afs_inode_set_ctime(inode, sec, nsec) inode_set_ctime((inode), (sec), (nsec))
+#else
+static inline void
+afs_inode_set_ctime(struct inode *inode, time64_t sec, long nsec)
+{
+ inode->i_ctime.tv_sec = sec;
+ inode->i_ctime.tv_nsec = nsec;
+}
+#endif
+
#undef gop_lookupname
#define gop_lookupname osi_lookupname
diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c
index fb62752..932fd9d 100644
--- a/src/afs/LINUX/osi_vnodeops.c
+++ b/src/afs/LINUX/osi_vnodeops.c
@@ -1144,8 +1144,7 @@
* any time the sysname list changes.
*/
ip->i_mtime.tv_nsec = afs_sysnamegen;
- ip->i_ctime.tv_sec = vp->va_ctime.tv_sec;
- ip->i_ctime.tv_nsec = 0;
+ afs_inode_set_ctime(ip, vp->va_ctime.tv_sec, 0);
}
/* afs_notify_change
diff --git a/src/cf/linux-kernel-func.m4 b/src/cf/linux-kernel-func.m4
index 105e58c..dc26b60 100644
--- a/src/cf/linux-kernel-func.m4
+++ b/src/cf/linux-kernel-func.m4
@@ -238,6 +238,12 @@
#include <linux/fs.h>],
[(void)wrap_directory_iterator(NULL, NULL, NULL);])
+dnl Linux 6.6 requires the use of a getter/setter for accessing a inode's
+dnl ctime member. Test for the setter inode_set_ctime
+AC_CHECK_LINUX_FUNC([inode_set_ctime],
+ [#include <linux/fs.h>],
+ [inode_set_ctime(NULL, 0, 0);])
+
dnl Consequences - things which get set as a result of the
dnl above tests
AS_IF([test "x$ac_cv_linux_func_d_alloc_anon" = "xno"],

View File

@ -1,4 +1,4 @@
From 474750a2008b2de37a05d6e51b31447d3a721dd4 Mon Sep 17 00:00:00 2001
From 6de0a646036283266e1d4aeb583e426005ca5ad4 Mon Sep 17 00:00:00 2001
From: Cheyenne Wills <cwills@sinenomine.net>
Date: Tue, 29 Aug 2023 14:58:10 -0600
Subject: [PATCH] linux: Replace fop iterate with fop iterate_shared
@ -31,6 +31,11 @@ Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 7437f4d37719ea53711e06ac9675dad1abd6769e)
Change-Id: Id00cfab2c0b51c2167fe19cd9cf7f136450ff174
Reviewed-on: https://gerrit.openafs.org/15558
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
---
diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c
@ -79,12 +84,12 @@ index dd8b39d..fb62752 100644
#else
.readdir = afs_linux_readdir,
diff --git a/src/cf/linux-kernel-func.m4 b/src/cf/linux-kernel-func.m4
index 8119549..1457255 100644
index b913676..105e58c 100644
--- a/src/cf/linux-kernel-func.m4
+++ b/src/cf/linux-kernel-func.m4
@@ -225,6 +225,16 @@
#include <linux/sysctl.h>],
[(void)register_sysctl(NULL, NULL);])
@@ -228,6 +228,16 @@
[[static struct ctl_table cf_sysctl_table[1];
(void)register_sysctl(NULL, cf_sysctl_table);]])
+dnl Linux 6.5 removed the file_operations method 'iterate'. Filesystems should
+dnl using the iterate_shared method (introduced in linux 4.6). Linux 6.4

View File

@ -1,3 +1,15 @@
-------------------------------------------------------------------
Fri Nov 10 08:53:16 UTC 2023 - Christof Hanke <christof.hanke@mpcdf.mpg.de>
- apply upstream-patches for kernel 6.6:
* 5b647bf.diff
* 6413fdb.diff
* 4f1d810.diff
- replace upstream-patch for kernel 6.5 474750a.diff by correct commit
6de0a64.diff for branch openafs-stable-1_8_x
-------------------------------------------------------------------
Mon Oct 2 07:29:50 UTC 2023 - Christof Hanke <christof.hanke@mpcdf.mpg.de>

View File

@ -108,7 +108,11 @@ Patch1: fef2457.diff
Patch2: d15c7ab.diff
Patch3: 63801cf.diff
Patch4: 538f450.diff
Patch5: 474750a.diff
Patch6: 6de0a64.diff
# PATCH-FIX-UPSTREAM fix build with kernel 6.6
Patch5: 5b647bf.diff
Patch7: 6413fdb.diff
Patch8: 4f1d810.diff
# GENERAL BuildRequires and Requires
#
@ -324,6 +328,9 @@ done
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
./regen.sh