ost count is different between original processing and replay.
not count ost twice in case ost connected before recovery finished.
Branch b_1_6
b=16736
i=tappro
i=green
struct mds_obd *mds = &obd->u.mds;
struct lvfs_run_ctxt saved;
struct lov_mds_md *lmm;
+ __u32 lmm_sz, cookie_sz;
struct llog_cookie *logcookies;
int rc = 0;
ENTRY;
push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
/* Close any open files (which may also cause orphan unlinking). */
- OBD_ALLOC(lmm, mds->mds_max_mdsize);
+ lmm_sz = mds->mds_max_mdsize;
+ OBD_ALLOC(lmm, lmm_sz);
if (lmm == NULL) {
CWARN("%s: allocation failure during cleanup; can not force "
"close file handles on this service.\n", obd->obd_name);
GOTO(out, rc = -ENOMEM);
}
- OBD_ALLOC(logcookies, mds->mds_max_cookiesize);
+ cookie_sz = mds->mds_max_cookiesize;
+ OBD_ALLOC(logcookies, cookie_sz);
if (logcookies == NULL) {
CWARN("%s: allocation failure during cleanup; can not force "
"close file handles on this service.\n", obd->obd_name);
- OBD_FREE(lmm, mds->mds_max_mdsize);
+ OBD_FREE(lmm, lmm_sz);
GOTO(out, rc = -ENOMEM);
}
struct list_head *tmp = med->med_open_head.next;
struct mds_file_data *mfd =
list_entry(tmp, struct mds_file_data, mfd_list);
- int lmm_size = mds->mds_max_mdsize;
+ int lmm_size = lmm_sz;
umode_t mode = mfd->mfd_dentry->d_inode->i_mode;
__u64 valid = 0;
spin_lock(&med->med_open_lock);
}
- OBD_FREE(logcookies, mds->mds_max_cookiesize);
- OBD_FREE(lmm, mds->mds_max_mdsize);
+ OBD_FREE(logcookies, cookie_sz);
+ OBD_FREE(lmm, lmm_sz);
spin_unlock(&med->med_open_lock);
inode->i_ino);
RETURN(0);
}
+ /* if this replay request we should be silencely exist without fill md*/
lmm_size = lustre_msg_buflen(msg, offset);
+ if (lmm_size == 0)
+ RETURN(0);
/* I don't really like this, but it is a sanity check on the client
* MD request. However, if the client doesn't know how much space
else if (it->opc & IT_UNLINK)
repsize[repbufcnt++] = mds->mds_max_cookiesize;
+ /* if we do recovery we isn't send reply mds state is restored */
+ if(lustre_msg_get_flags(req->rq_reqmsg) & MSG_REPLAY) {
+ repsize[DLM_REPLY_REC_OFF+1] = 0;
+ if (it->opc & IT_UNLINK)
+ repsize[DLM_REPLY_REC_OFF+2] = 0;
+ }
+
rc = lustre_pack_reply(req, repbufcnt, repsize, NULL);
if (rc)
RETURN(req->rq_status = rc);
rep = lustre_msg_buf(req->rq_repmsg, DLM_LOCKREPLY_OFF, sizeof(*rep));
intent_set_disposition(rep, DISP_IT_EXECD);
-
/* execute policy */
switch ((long)it->opc) {
case IT_OPEN:
if (data[off] == 0) {
__u32 stripes;
+ data[off] = 1;
mds->mds_lov_objid_count++;
stripes = min_t(__u32, LOV_MAX_STRIPE_COUNT,
mds->mds_lov_objid_count);
CDEBUG(D_CONFIG, "updated lov_desc, tgt_count: %d\n",
mds->mds_lov_desc.ld_tgt_count);
- if (mds_lov_update_max_ost(mds, index))
+ mutex_down(&obd->obd_dev_sem);
+ rc = mds_lov_update_max_ost(mds, index);
+ mutex_up(&obd->obd_dev_sem);
+ if (rc)
GOTO(out, rc = -ENOMEM);
/* If we added a target we have to reconnect the llogs */
ENTRY;
/* Don't let anyone else mess with mds_lov_objids now */
- mutex_down(&obd->obd_dev_sem);
-
old_count = mds->mds_lov_desc.ld_tgt_count;
rc = mds_lov_update_desc(obd, mds->mds_osc_exp, idx);
- mutex_up(&obd->obd_dev_sem);
if (rc)
GOTO(out, rc);
mds_lov_connect. */
idx = mds_lov_get_idx(obd->u.mds.mds_osc_exp,
&watched->u.cli.cl_target_uuid);
- mutex_down(&obd->obd_dev_sem);
rc = mds_lov_update_desc(obd, obd->u.mds.mds_osc_exp, idx);
- mutex_up(&obd->obd_dev_sem);
-
mds_allow_cli(obd, CONFIG_SYNC);
RETURN(rc);
}
rc = fsfilt_set_md(obd, inode, *handle, lmm, lmm_size, "lov");
if (rc)
CERROR("open replay failed to set md:%d\n", rc);
- lmm_buf = lustre_msg_buf(req->rq_repmsg, offset, lmm_size);
- LASSERT(lmm_buf);
- memcpy(lmm_buf, lmm, lmm_size);
- *objid = lmm_buf;
+ /* for replay we not need send lmm to client, this not used now */
+ lustre_shrink_reply(req, offset, 0, 1);
+ *objid = lmm;
+
RETURN(rc);
}
obdo_from_inode(oinfo.oi_oa, inode, OBD_MD_FLTYPE | OBD_MD_FLATIME |
OBD_MD_FLMTIME | OBD_MD_FLCTIME);
-
if (!(rec->ur_flags & MDS_OPEN_HAS_OBJS)) {
/* check if things like lfs setstripe are sending us the ea */
if (rec->ur_flags & MDS_OPEN_HAS_EA) {
if (rc)
GOTO(out_oa, rc);
} else {
- OBD_ALLOC(lmm, mds->mds_max_mdsize);
+ __u32 lmm_sz = mds->mds_max_mdsize;
+ OBD_ALLOC(lmm, lmm_sz);
if (lmm == NULL)
GOTO(out_oa, rc = -ENOMEM);
- lmm_size = mds->mds_max_mdsize;
+ lmm_size = lmm_sz;
rc = mds_get_md(obd, dchild->d_parent->d_inode,
lmm, &lmm_size, 1, 0);
if (rc > 0)
rc = obd_iocontrol(OBD_IOC_LOV_SETSTRIPE,
mds->mds_osc_exp,
0, &oinfo.oi_md, lmm);
- OBD_FREE(lmm, mds->mds_max_mdsize);
+ OBD_FREE(lmm, lmm_sz);
if (rc)
GOTO(out_oa, rc);
}