Skip to contentSkip to conversation

fixup error when LINUX_BACKPORT macro was added

PATCH In review Andy Gospodarek 3 participants 4 messages Apr 5, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 fixup error when LINUX_BACKPORT macro was added

Commit a05e783cb8853210628bd1f2bd82d17dd004c9d1 did not properly backport the symbols for:

schedule_delayed_work
schedule_delayed_work_on

as it left the 'compat' string there when adding the LINUX_BACKPORT symbol. This resulted in these two not getting redefined and kernels with these backported resulted in duplicate symbols when trying to load compat.ko.

---
 include/linux/compat-2.6.36.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/linux/compat-2.6.36.h +2 -2
index d90b84f..b760a62 100644
@@ -168,10 +168,10 @@ void backport_system_workqueue_destroy(void);
 int schedule_work(struct work_struct *work);
 #define schedule_work_on LINUX_BACKPORT(schedule_work_on)
 int schedule_work_on(int cpu, struct work_struct *work);
-#define compat_schedule_delayed_work LINUX_BACKPORT(compat_schedule_delayed_work)
+#define schedule_delayed_work LINUX_BACKPORT(schedule_delayed_work)
 int schedule_delayed_work(struct delayed_work *dwork,
 			  unsigned long delay);
-#define compat_schedule_delayed_work_on LINUX_BACKPORT(compat_schedule_delayed_work_on)
+#define schedule_delayed_work_on LINUX_BACKPORT(schedule_delayed_work_on)
 int schedule_delayed_work_on(int cpu,
 			     struct delayed_work *dwork,
 			     unsigned long delay);
Signature · 1 line
1.8.1.4
#1 lore raw

PATCH 2/2 more symbol fixup needed for latest RHEL6.3 kernels

These changes will allow compat.ko to load properly on the latest released RHEL6.3 errata kernels.

Reported here: https://bugzilla.kernel.org/show_bug.cgi?id=55971

---
 include/linux/compat-2.6.34.h |  2 ++
 include/linux/compat-2.6.35.h |  3 +++
 include/linux/compat-2.6.39.h |  2 ++
 include/linux/compat-3.0.h    |  3 ++-
 include/linux/compat-3.3.h    | 18 ++++++++++++++++++
 5 files changed, 27 insertions(+), 1 deletion(-)
include/linux/compat-2.6.34.h +2 -0
index 09d5922..d444853 100644
@@ -290,7 +290,9 @@ static inline int usb_enable_autosuspend(struct usb_device *udev)
 static inline int usb_disable_autosuspend(struct usb_device *udev)
 { return 0; }
 
+#if !defined(rcu_dereference_protected)
 #define rcu_dereference_protected(p, c) (p)
+#endif
 #define rcu_access_pointer(p)   ACCESS_ONCE(p)
 
 #define rcu_dereference_raw(p)	rcu_dereference(p)
include/linux/compat-2.6.35.h +3 -0
index 99968bf..cb43472 100644
@@ -25,6 +25,9 @@
 #define netdev_hw_addr dev_mc_list
 
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27))
+
+#define qdisc_reset_all_tx_gt LINUX_BACKPORT(qdisc_reset_all_tx_gt)
+
 /* Reset all TX qdiscs greater then index of a device.  */
 static inline void qdisc_reset_all_tx_gt(struct net_device *dev, unsigned int i)
 {
include/linux/compat-2.6.39.h +2 -0
index e9a2eba..863afa4 100644
@@ -18,7 +18,9 @@ static inline int __must_check PTR_RET(const void *ptr)
 		return 0;
 }
 
+#if !defined(NETIF_F_RXCSUM)
 #define NETIF_F_RXCSUM 0
+#endif
 
 #define tiocmget(tty) tiocmget(tty, NULL)
 #define tiocmset(tty, set, clear) tiocmset(tty, NULL, set, clear)
include/linux/compat-3.0.h +2 -1
index 7fcd763..0bf179d 100644
@@ -119,6 +119,7 @@ static inline int __must_check kstrtos32_from_user(const char __user *s, size_t
  * The rcu callback could happen every time also after the module was
  *  unloaded and this will cause problems.
  */
+#if !defined(kfree_rcu)
 #define kfree_rcu(data, rcuhead)		do {			\
 		void __kfree_rcu_fn(struct rcu_head *rcu_head)		\
 		{							\
@@ -128,7 +129,7 @@ static inline int __must_check kstrtos32_from_user(const char __user *s, size_t
 		}							\
 		call_rcu(&(data)->rcuhead, __kfree_rcu_fn);		\
 	} while (0)
-
+#endif
 #ifdef MODULE
 
 /*
include/linux/compat-3.3.h +18 -0
index ee4b7ce..2af4a52 100644
@@ -56,6 +56,9 @@ static inline void netdev_reset_queue(struct net_device *dev_queue)
 }
 #endif /* CONFIG_BQL */
 
+
+#define ethtool_adv_to_mii_adv_t LINUX_BACKPORT(ethtool_adv_to_mii_adv_t)
+
 /**
  * ethtool_adv_to_mii_adv_t
  * @ethadv: the ethtool advertisement settings
@@ -84,6 +87,8 @@ static inline u32 ethtool_adv_to_mii_adv_t(u32 ethadv)
 	return result;
 }
 
+#define mii_adv_to_ethtool_adv_t LINUX_BACKPORT(mii_adv_to_ethtool_adv_t)
+
 /**
  * mii_adv_to_ethtool_adv_t
  * @adv: value of the MII_ADVERTISE register
@@ -111,6 +116,8 @@ static inline u32 mii_adv_to_ethtool_adv_t(u32 adv)
 	return result;
 }
 
+#define ethtool_adv_to_mii_ctrl1000_t LINUX_BACKPORT(ethtool_adv_to_mii_ctrl1000_t)
+
 /**
  * ethtool_adv_to_mii_ctrl1000_t
  * @ethadv: the ethtool advertisement settings
@@ -131,6 +138,8 @@ static inline u32 ethtool_adv_to_mii_ctrl1000_t(u32 ethadv)
 	return result;
 }
 
+#define mii_ctrl1000_to_ethtool_adv_t LINUX_BACKPORT(mii_ctrl1000_to_ethtool_adv_t)
+
 /**
  * mii_ctrl1000_to_ethtool_adv_t
  * @adv: value of the MII_CTRL1000 register
@@ -151,6 +160,8 @@ static inline u32 mii_ctrl1000_to_ethtool_adv_t(u32 adv)
 	return result;
 }
 
+#define mii_lpa_to_ethtool_lpa_t LINUX_BACKPORT(mii_lpa_to_ethtool_lpa_t)
+
 /**
  * mii_lpa_to_ethtool_lpa_t
  * @adv: value of the MII_LPA register
@@ -169,6 +180,8 @@ static inline u32 mii_lpa_to_ethtool_lpa_t(u32 lpa)
 	return result | mii_adv_to_ethtool_adv_t(lpa);
 }
 
+#define mii_stat1000_to_ethtool_lpa_t LINUX_BACKPORT(mii_stat1000_to_ethtool_lpa_t)
+
 /**
  * mii_stat1000_to_ethtool_lpa_t
  * @adv: value of the MII_STAT1000 register
@@ -189,6 +202,7 @@ static inline u32 mii_stat1000_to_ethtool_lpa_t(u32 lpa)
 	return result;
 }
 
+#define ethtool_adv_to_mii_adv_x LINUX_BACKPORT(ethtool_adv_to_mii_adv_x)
 /**
  * ethtool_adv_to_mii_adv_x
  * @ethadv: the ethtool advertisement settings
@@ -213,6 +227,8 @@ static inline u32 ethtool_adv_to_mii_adv_x(u32 ethadv)
 	return result;
 }
 
+#define mii_adv_to_ethtool_adv_x LINUX_BACKPORT(mii_adv_to_ethtool_adv_x)
+
 /**
  * mii_adv_to_ethtool_adv_x
  * @adv: value of the MII_CTRL1000 register
@@ -237,6 +253,8 @@ static inline u32 mii_adv_to_ethtool_adv_x(u32 adv)
 	return result;
 }
 
+#define mii_lpa_to_ethtool_lpa_x LINUX_BACKPORT(mii_lpa_to_ethtool_lpa_x)
+
 /**
  * mii_lpa_to_ethtool_lpa_x
  * @adv: value of the MII_LPA register
Signature · 1 line
1.8.1.4
#2 lore raw

Re: [PATCH 2/2] more symbol fixup needed for latest RHEL6.3 kernels

Quoted 6 lines · Andy Gospodarek

These changes will allow compat.ko to load properly on the latest released RHEL6.3 errata kernels.

Reported here: https://bugzilla.kernel.org/show_bug.cgi?id=55971

Thanks! Can you port these over to Johannes' backports tree ? I've frozen development on compat / compat-drivers as we transition over. I will be sure to merge fixes for stable releases that were already depending on compat / compat-drivers, these however seem to be development window fixes.

Luis

#3 lore raw

Re: [PATCH 2/2] more symbol fixup needed for latest RHEL6.3 kernels

Quoted 6 lines · Luis R. Rodriguez
Quoted 5 lines · Andy Gospodarek

These changes will allow compat.ko to load properly on the latest released RHEL6.3 errata kernels.

Reported here: https://bugzilla.kernel.org/show_bug.cgi?id=55971

Quoted 7 lines
Quoted 1 line

Thanks! Can you port these over to Johannes' backports tree ? I've frozen development on compat / compat-drivers as we transition over. I will be sure to merge fixes for stable releases that were already depending on compat / compat-drivers, these however seem to be development window fixes.

It's ok, I just had to fix up the paths a bit and then the patches applied just fine.

johannes