* [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: Fix colliding redefinition of file_dentry
@ 2018-09-24 9:16 Sven Eckelmann
2018-09-24 9:16 ` [B.A.T.M.A.N.] [PATCH maint 2/2] batman-adv: Fix colliding redefinition of skb_postpush_rcsum Sven Eckelmann
0 siblings, 1 reply; 2+ messages in thread
From: Sven Eckelmann @ 2018-09-24 9:16 UTC (permalink / raw)
To: b.a.t.m.a.n
Linux >=4.4.8 have the function file_dentry already defined while Linux 4.5
only got it with v4.5.2. Older stable kernel versions might also have
gotten this function. Maintaining a full list of kernel versions which have
this functionality is too much of a burden and thus the calls to this
function are simply replaced with calls to a new private function
batadv_file_dentry.
Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
compat-include/linux/fs.h | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/compat-include/linux/fs.h b/compat-include/linux/fs.h
index 4d6bb1d7..e0d6f7c7 100644
--- a/compat-include/linux/fs.h
+++ b/compat-include/linux/fs.h
@@ -27,11 +27,20 @@
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0)
-static inline struct dentry *file_dentry(const struct file *file)
+static inline struct dentry *batadv_file_dentry(const struct file *file)
{
- return file->f_path.dentry;
+ struct dentry *dentry = file->f_path.dentry;
+
+#ifdef DCACHE_OP_REAL
+ if (unlikely(dentry->d_flags & DCACHE_OP_REAL))
+ return dentry->d_op->d_real(dentry, file_inode(file));
+#endif
+
+ return dentry;
}
+#define file_dentry batadv_file_dentry
+
#endif /* < KERNEL_VERSION(4, 6, 0) */
#endif /* _NET_BATMAN_ADV_COMPAT_LINUX_FS_H_ */
--
2.11.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [B.A.T.M.A.N.] [PATCH maint 2/2] batman-adv: Fix colliding redefinition of skb_postpush_rcsum
2018-09-24 9:16 [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: Fix colliding redefinition of file_dentry Sven Eckelmann
@ 2018-09-24 9:16 ` Sven Eckelmann
0 siblings, 0 replies; 2+ messages in thread
From: Sven Eckelmann @ 2018-09-24 9:16 UTC (permalink / raw)
To: b.a.t.m.a.n
Linux >=4.4.47 have the function skb_postpush_rcsum already and also v3.16
got it with v3.16.57. Even older stable kernel versions might also have
gotten this function with a stable release. Maintaining a full list of
kernel versions which have this functionality is too much of a burden and
thus the calls to this function are simply replaced with calls to a new
private function batadv_skb_postpush_rcsum.
Reported-by: Andreas Ziegler <dev@andreas-ziegler.de>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
compat-include/linux/skbuff.h | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/compat-include/linux/skbuff.h b/compat-include/linux/skbuff.h
index 36e4d10d..376ea10b 100644
--- a/compat-include/linux/skbuff.h
+++ b/compat-include/linux/skbuff.h
@@ -45,16 +45,18 @@ struct sk_buff *skb_checksum_trimmed(struct sk_buff *skb,
#endif /* < KERNEL_VERSION(4, 2, 0) */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 47)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0)
-static inline void skb_postpush_rcsum(struct sk_buff *skb,
- const void *start, unsigned int len)
+static inline void batadv_skb_postpush_rcsum(struct sk_buff *skb,
+ const void *start, unsigned int len)
{
if (skb->ip_summed == CHECKSUM_COMPLETE)
skb->csum = csum_block_add(skb->csum,
csum_partial(start, len, 0), 0);
}
+#define skb_postpush_rcsum batadv_skb_postpush_rcsum
+
#endif /* < KERNEL_VERSION(4, 5, 0) */
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 13, 0)
--
2.11.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-09-24 9:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-24 9:16 [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: Fix colliding redefinition of file_dentry Sven Eckelmann
2018-09-24 9:16 ` [B.A.T.M.A.N.] [PATCH maint 2/2] batman-adv: Fix colliding redefinition of skb_postpush_rcsum Sven Eckelmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).