summarylogtreecommitdiffstats
path: root/0009-Linux-6.6-Pass-request_mask-to-generic_fillattr.patch
blob: 1a961517969fc1400aa6a34249d91007189536c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
From 0f36a779b39e7b020f2ea841b59bfe06ddf9773f Mon Sep 17 00:00:00 2001
From: Cheyenne Wills <cwills@sinenomine.net>
Date: Mon, 18 Sep 2023 12:23:01 -0600
Subject: [PATCH 9/9] 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>
(cherry picked from commit 4f1d8104d17d2b4e95c7abaf5498db6b80aefa8f)
---
 src/afs/LINUX/osi_vnodeops.c    |  4 ++++
 src/cf/linux-kernel-assorted.m4 |  1 +
 src/cf/linux-test4.m4           | 13 +++++++++++++
 3 files changed, 18 insertions(+)

diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c
index 1eb99d1d4..8a49781b9 100644
--- a/src/afs/LINUX/osi_vnodeops.c
+++ b/src/afs/LINUX/osi_vnodeops.c
@@ -1195,7 +1195,11 @@ afs_linux_getattr(struct mnt_idmap *idmap, const struct path *path, struct kstat
 {
 	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 b3a11bc3a..49827d5be 100644
--- a/src/cf/linux-kernel-assorted.m4
+++ b/src/cf/linux-kernel-assorted.m4
@@ -58,6 +58,7 @@ LINUX_IOP_LOOKUP_TAKES_UNSIGNED
 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 0d6b645f4..f15c6b94d 100644
--- a/src/cf/linux-test4.m4
+++ b/src/cf/linux-test4.m4
@@ -853,3 +853,16 @@ AC_DEFUN([LINUX_KEYRING_SEARCH_TAKES_RECURSE], [
                        [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],
+                       [])
+])
-- 
2.42.1