Blob Blame History Raw
From: NeilBrown <neilb@suse.de>
Subject: kabi fix for SUNRPC-dont-update-timeout-value-on-connection-reset.patch
Patch-mainline: never, kabi
References: bsc1174263

The mentioned patsch adds an 'unsigned long' to 'struct rpc_rqst'.  This
structure can be allocated by a loadable module, so increasing the size
of the structure is not an option.

The best option seems to be to re-arrange some fields that are not used
by modules, to make some space available.

'rq_timeout' is allocated as 'unsigned long' but doesn't need to store
more than a few minutes in jiffies.  18 bits (250 seconds - about 5
minutes) is probably enough, so make it 24 bits.

'rq_retries' counts retries between major timeouts, This is typically 2
or 3 at most, so 8 bits should suffice.

The revised rq_timeout and rq_retries go in the 32bits previously used
vy rq_retries, and the new rq_minortimeo goes in the 'unsigned long'
previously used by rq_timeout.

Signed-off-by: NeilBrown <neilb@suse.de>

---
 include/linux/sunrpc/xprt.h |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

--- a/include/linux/sunrpc/xprt.h
+++ b/include/linux/sunrpc/xprt.h
@@ -103,10 +103,20 @@ struct rpc_rqst {
 							 * used in the softirq.
 							 */
 	unsigned long		rq_majortimeo;	/* major timeout alarm */
-	unsigned long		rq_minortimeo;	/* minor timeout alarm */
+#ifdef __GENKSYMS__
 	unsigned long		rq_timeout;	/* Current timeout value */
+#else
+	unsigned long		rq_minortimeo;	/* minor timeout alarm */
+#endif
 	ktime_t			rq_rtt;		/* round-trip time */
+#ifdef __GENKSYMS__
 	unsigned int		rq_retries;	/* # of retries */
+#else
+	unsigned int		rq_retries:8;	/* # of retries */
+	unsigned int		rq_timeout:24;	/* Current timeout value -
+						 * Upto a few minutes in jiffies
+						 */
+#endif
 	unsigned int		rq_connect_cookie;
 						/* A cookie used to track the
 						   state of the transport