Whamcloud - gitweb
correctly send lsm on open replay
authorshadow <shadow>
Thu, 20 Aug 2009 16:00:52 +0000 (16:00 +0000)
committershadow <shadow>
Thu, 20 Aug 2009 16:00:52 +0000 (16:00 +0000)
Branch b_release_1_8_1
b=19934
i=tappro
i=panda

lustre/ChangeLog
lustre/mdc/mdc_locks.c
lustre/mds/mds_open.c

index ae45d8b..5dc83ec 100644 (file)
@@ -16,6 +16,12 @@ TBD Sun Microsystems, Inc.
          used in production.
 
 Severity   : normal
+Bugzilla   : 19934
+Description: correctly send lsm on open replay
+Details    : MDS is trust to LSM size on replay open, but client can set wrong size
+             of lsm buffer.
+
+Severity   : normal
 Bugzilla   : 20321
 Description: Deadlock between filter_destroy() and filter_commitrw_write().
 Details    : filter_destroy() does not hold the DLM lock over the whole
index 492eeea..8d52e21 100644 (file)
@@ -191,6 +191,10 @@ static void mdc_realloc_openmsg(struct ptlrpc_request *req,
         old_size = lustre_packed_msg_size(old_msg);
         lustre_msg_set_buflen(old_msg, DLM_INTENT_REC_OFF + offset,
                               body->eadatasize);
+        /* old buffer is more then need */
+        if (old_len > body->eadatasize)
+                return;
+
         new_size = lustre_packed_msg_size(old_msg);
 
         OBD_ALLOC(new_msg, new_size);
@@ -538,7 +542,7 @@ static int mdc_finish_enqueue(struct obd_export *exp,
                                 else
                                         offset += 2;
 
-                                if (lustre_msg_buflen(req->rq_reqmsg, offset) <
+                                if (lustre_msg_buflen(req->rq_reqmsg, offset) !=
                                     body->eadatasize)
                                         mdc_realloc_openmsg(req, body);
 
index 41480df..987a81c 100644 (file)
@@ -361,6 +361,8 @@ static int mds_create_objects(struct ptlrpc_request *req, int offset,
                 lmm_size = rec->ur_eadatalen;
                 lmm = rec->ur_eadata;
                 LASSERT(lmm);
+                LASSERT(lov_mds_md_size(lmm->lmm_stripe_count,
+                                        lmm->lmm_magic) == lmm_size);
 
                 if (*handle == NULL) {
                         int stripe_count = le32_to_cpu(lmm->lmm_stripe_count);