Whamcloud - gitweb
b=20020 don't shrink if no mds_body
authorJohann Lombardi <johann@sun.com>
Thu, 14 Jan 2010 10:59:00 +0000 (11:59 +0100)
committerJohann Lombardi <johann@sun.com>
Thu, 14 Jan 2010 10:59:00 +0000 (11:59 +0100)
i=andrew
i=dmitry

Fix bug found on lol when the group upcall returns EIDRM.
We incorrectly shrink the reply while there is no mds_body.

lustre/mds/handler.c
lustre/mds/mds_reint.c

index 9f97a21..5c6ffd0 100644 (file)
@@ -1087,11 +1087,12 @@ out_ucred:
                         rc = rc2;
                 if (rc != 0)
                         req->rq_status = rc;
+        } else {
+                mds_shrink_body_reply(req, offset, REPLY_REC_OFF);
         }
         mds_exit_ucred(&uc, mds);
 
 cleanup_exit:
-        mds_shrink_body_reply(req, offset, REPLY_REC_OFF);
         return rc;
 }
 
index 4798f43..97dc613 100644 (file)
@@ -1804,9 +1804,13 @@ static void mds_shrink_reply(struct ptlrpc_request *req,
         /* LSM and cookie is always placed after mds_body */
         reply_body =  lustre_msg_buf(req->rq_repmsg, reply_mdoff,
                                      sizeof(*reply_body));
+        if (reply_body == NULL)
+                /* if there is no mds_body, no point in shrinking the reply */
+                 return;
+
         reply_mdoff++;
 
-        if (reply_body && (have_md || have_acl)) {
+        if (have_md || have_acl) {
                 if (reply_body->valid & (OBD_MD_FLEASIZE | OBD_MD_FLDIREA)) {
                         md_size = reply_body->eadatasize;
                 } else if (reply_body->valid & OBD_MD_LINKNAME)