From: johann Date: Wed, 21 Oct 2009 09:20:28 +0000 (+0000) Subject: Branch b1_8 X-Git-Tag: v1_8_2_01~1^2~7 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=9cbfa0ad72e712c86b86d9b1d2728934d0481d14;p=fs%2Flustre-release.git Branch b1_8 b=20318 i=adilger i=panda don't memcmp magic in the updgrade/downgrade case when lsm magic has change from/to v1 to/from v3. --- diff --git a/lustre/include/obd.h b/lustre/include/obd.h index 10375f0..ad93b0e 100644 --- a/lustre/include/obd.h +++ b/lustre/include/obd.h @@ -199,17 +199,22 @@ struct obd_info { static inline int lov_stripe_md_cmp(struct lov_stripe_md *m1, struct lov_stripe_md *m2) { - int len = sizeof(m1->lsm_wire); + if ((m1->lsm_magic == LOV_MAGIC_V1 && m2->lsm_magic == LOV_MAGIC_V3) || + (m1->lsm_magic == LOV_MAGIC_V3 && m2->lsm_magic == LOV_MAGIC_V1)) + /* + * Dowgrade/upgrade case (b=20318) to a version that + * doesn't/does OST pools. Compare only objid and stripe + * size/count in this case + */ + return m1->lsm_object_id != m2->lsm_object_id || + m1->lsm_stripe_size != m2->lsm_stripe_size || + m1->lsm_stripe_count != m2->lsm_stripe_count; /* * ->lsm_wire contains padding, but it should be zeroed out during - * allocation. If either lsm is LOV_MAGIC_V1 do not check that - * the pool is the same, due to downgrade/upgrade (b=20318). This - * assumes that lw_pool_name is the last member in lsm_wire. + * allocation. */ - if (m1->lsm_magic == LOV_MAGIC_V1 || m2->lsm_magic == LOV_MAGIC_V1) - len -= LOV_MAXPOOLNAME; - return memcmp(&m1->lsm_wire, &m2->lsm_wire, len); + return memcmp(&m1->lsm_wire, &m2->lsm_wire, sizeof(m1->lsm_wire)); } void lov_stripe_lock(struct lov_stripe_md *md);