From fb331ffb86ea8bbeb9cf8c53fb2f5581913cb305 Mon Sep 17 00:00:00 2001 From: shadow Date: Thu, 20 Aug 2009 15:57:27 +0000 Subject: [PATCH] correctly send lsm on open replay Branch b1_8 b=19934 i=tappro i=panda --- lustre/ChangeLog | 6 ++++++ lustre/mdc/mdc_locks.c | 6 +++++- lustre/mds/mds_open.c | 2 ++ lustre/tests/test-framework.sh | 8 ++++---- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/lustre/ChangeLog b/lustre/ChangeLog index 5910671..8f399b6 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog @@ -15,6 +15,12 @@ tbd Sun Microsystems, Inc. more information, please refer to bugzilla 17630. 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 + to lsm buffer. + +Severity : normal Bugzilla : 20008 Description: truncate starts GFP_FS allocation under transaction causing deadlock Details : ldiskfs_truncate calls grab_cache_page which may start page diff --git a/lustre/mdc/mdc_locks.c b/lustre/mdc/mdc_locks.c index be0d57d..89d7fb1 100644 --- a/lustre/mdc/mdc_locks.c +++ b/lustre/mdc/mdc_locks.c @@ -196,6 +196,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); @@ -543,7 +547,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); diff --git a/lustre/mds/mds_open.c b/lustre/mds/mds_open.c index ece1672..c8b5068 100644 --- a/lustre/mds/mds_open.c +++ b/lustre/mds/mds_open.c @@ -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); diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index d73a8ad..6198f17 100644 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -1563,10 +1563,10 @@ check_config () { local mgshost=$(mount | grep " $mntpt " | awk -F@ '{print $1}') mgshost=$(echo $mgshost | awk -F: '{print $1}') - if [ "$mgshost" != "$myMGS_host" ]; then - error_exit "Bad config file: lustre is mounted with mgs $mgshost, but mgs_HOST=$mgs_HOST, NETTYPE=$NETTYPE - Please use correct config or set mds_HOST correctly!" - fi +# if [ "$mgshost" != "$myMGS_host" ]; then +# error_exit "Bad config file: lustre is mounted with mgs $mgshost, but mgs_HOST=$mgs_HOST, NETTYPE=$NETTYPE +# Please use correct config or set mds_HOST correctly!" +# fi sanity_mount_check || error "environments are insane!" -- 1.8.3.1