From be7cd165b85e993e503f445602510167a8f802a8 Mon Sep 17 00:00:00 2001 From: Johann Lombardi Date: Thu, 14 Jan 2010 11:59:00 +0100 Subject: [PATCH] b=20020 don't shrink if no mds_body 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 | 3 ++- lustre/mds/mds_reint.c | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lustre/mds/handler.c b/lustre/mds/handler.c index 9f97a21..5c6ffd0 100644 --- a/lustre/mds/handler.c +++ b/lustre/mds/handler.c @@ -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; } diff --git a/lustre/mds/mds_reint.c b/lustre/mds/mds_reint.c index 4798f43..97dc613 100644 --- a/lustre/mds/mds_reint.c +++ b/lustre/mds/mds_reint.c @@ -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) -- 1.8.3.1