path: root/rpc/rpc-lib
diff options
authorSantosh Kumar Pradhan <>2014-01-03 10:32:16 +0530
committerVijay Bellur <>2014-01-03 22:15:01 -0800
commit311e3868bfdb3f2c1535d5a7cb8f759195457612 (patch)
treefff3084fb2b451fd9dfa44ab5282c2dd82dd1993 /rpc/rpc-lib
parent8ee2420266a0a1c47fcfee0796ef08d93d0797ab (diff)
gNFS: Possible SEGV crash in NFS while DRC is OFF
In rpcsvc_submit_generic(), FILE: rpc/rpc-lib/src/rpcsvc.c, while caching the reply (DRC), the code does not check if DRC is ON and goes ahead assuming DRC is on and try to take a LOCK on drc. FIX: Put a check on svc->drc by rpcsvc_need_drc(). Change-Id: I52c57280487e6061c68fd0b784e1cafceb2f3690 BUG: 1048072 Signed-off-by: Santosh Kumar Pradhan <> Reviewed-on: Reviewed-by: Niels de Vos <> Tested-by: Gluster Build System <> Reviewed-by: Vijay Bellur <>
Diffstat (limited to 'rpc/rpc-lib')
1 files changed, 1 insertions, 1 deletions
diff --git a/rpc/rpc-lib/src/rpcsvc.c b/rpc/rpc-lib/src/rpcsvc.c
index 037c157f2..d19a3ca0c 100644
--- a/rpc/rpc-lib/src/rpcsvc.c
+++ b/rpc/rpc-lib/src/rpcsvc.c
@@ -1183,7 +1183,7 @@ rpcsvc_submit_generic (rpcsvc_request_t *req, struct iovec *proghdr,
iobref_add (iobref, replyiob);
/* cache the request in the duplicate request cache for appropriate ops */
- if (req->reply) {
+ if ((req->reply) && (rpcsvc_need_drc (req))) {
drc = req->svc->drc;
LOCK (&drc->lock);