Another small rpc_procinfo glitch...

Trond Myklebust (trond.myklebust@fys.uio.no)
Fri, 5 Nov 1999 19:04:18 +0100 (CET)


Hi Alan and Linus,

The following fixes a small initialization glitch in the lock
monitoring RPC calls. It's the same sort of problem as Peter Braam
discovered for NFSroot mounting, which causes an incorrect buffer size
to be specified to the SunRPC layer.

Please note: the patch is against linux-2.2.13, but should also be
applied to 2.3.25.

Cheers,
Trond

--- linux-2.2.13/fs/lockd/mon.c.orig Wed Oct 20 02:14:02 1999
+++ linux-2.2.13/fs/lockd/mon.c Fri Nov 5 18:57:50 1999
@@ -195,6 +195,12 @@
#define SM_my_id_sz (3+1+SM_my_name_sz)
#define SM_mon_id_sz (1+XDR_QUADLEN(20)+SM_my_id_sz)
#define SM_mon_sz (SM_mon_id_sz+4)
+#define SM_monres_sz 2
+#define SM_unmonres_sz 1
+
+#ifndef MAX
+# define MAX(a, b) (((a) > (b))? (a) : (b))
+#endif

static struct rpc_procinfo nsm_procedures[] = {
{ "sm_null",
@@ -205,10 +211,10 @@
(kxdrproc_t) xdr_error, 0, 0 },
{ "sm_mon",
(kxdrproc_t) xdr_encode_mon,
- (kxdrproc_t) xdr_decode_stat_res, SM_mon_sz, 2 },
+ (kxdrproc_t) xdr_decode_stat_res, MAX(SM_mon_sz, SM_monres_sz) << 2, 0 },
{ "sm_unmon",
(kxdrproc_t) xdr_encode_mon,
- (kxdrproc_t) xdr_decode_stat, SM_mon_id_sz, 1 },
+ (kxdrproc_t) xdr_decode_stat, MAX(SM_mon_id_sz, SM_unmonres_sz) << 2, 0 },
{ "sm_unmon_all",
(kxdrproc_t) xdr_error,
(kxdrproc_t) xdr_error, 0, 0 },

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/