struct mdc_open_data;
struct obd_client_handle {
struct lustre_handle och_fh;
+ struct lu_fid *och_fid;
struct llog_cookie och_cookie;
struct mdc_open_data *och_mod;
__u32 och_magic;
memcpy(&och->och_fh, &body->handle, sizeof(body->handle));
och->och_magic = OBD_CLIENT_HANDLE_MAGIC;
+ och->och_fid = &lli->lli_fid;
lli->lli_io_epoch = body->io_epoch;
- md_set_open_replay_data(md_exp, och, it->d.lustre.it_data);
+ md_set_open_replay_data(md_exp, och, req);
}
int ll_local_open(struct file *file, struct lookup_intent *it,
if (body->valid & OBD_MD_FLSIZE)
set_bit(LLI_F_HAVE_MDS_SIZE_LOCK, &lli->lli_flags);
- if (body->valid & OBD_MD_FLID)
- lli->lli_fid = body->fid1;
+ if (body->valid & OBD_MD_FLID) {
+ /* FID shouldn't be changed! */
+ if (fid_is_sane(&lli->lli_fid)) {
+ LASSERTF(lu_fid_eq(&lli->lli_fid, &body->fid1),
+ "Trying to change FID "DFID
+ " to the "DFID", inode %lu/%u(%p)\n",
+ PFID(&lli->lli_fid), PFID(&body->fid1),
+ inode->i_ino, inode->i_generation, inode);
+ } else
+ lli->lli_fid = body->fid1;
+ }
LASSERT(fid_seq(&lli->lli_fid) != 0);
}
struct lustre_handle plock;
struct md_op_data *op_data;
struct obd_export *tgt_exp;
- struct lu_fid nid;
int pmode, rc = 0;
ENTRY;
LASSERT(fid_is_sane(&body->fid1));
- nid = body->fid1;
it->d.lustre.it_disposition &= ~DISP_ENQ_COMPLETE;
OBD_ALLOC_PTR(op_data);
if (op_data == NULL)
GOTO(out, rc = -ENOMEM);
- op_data->fid1 = nid;
+ op_data->fid1 = body->fid1;
- tgt_exp = lmv_get_export(lmv, &nid);
+ tgt_exp = lmv_get_export(lmv, &body->fid1);
if (IS_ERR(tgt_exp))
RETURN(PTR_ERR(tgt_exp));
if (it->d.lustre.it_disposition & DISP_LOOKUP_NEG)
GOTO(out_free_op_data, rc = 0);
+ LASSERT(*reqp);
+ LASSERT((*reqp)->rq_repmsg);
body = lustre_msg_buf((*reqp)->rq_repmsg, DLM_REPLY_REC_OFF, sizeof(*body));
LASSERT(body != NULL);
}
int lmv_get_lustre_md(struct obd_export *exp, struct ptlrpc_request *req,
- int offset, struct obd_export *dt_exp, struct lustre_md *md)
+ int offset, struct obd_export *dt_exp,
+ struct lustre_md *md)
{
struct obd_device *obd = exp->exp_obd;
struct lmv_obd *lmv = &obd->u.lmv;
{
struct obd_device *obd = exp->exp_obd;
struct lmv_obd *lmv = &obd->u.lmv;
+ struct obd_export *tgt_exp;
ENTRY;
- RETURN(md_set_open_replay_data(lmv->tgts[0].ltd_exp,
- och, open_req));
+
+ tgt_exp = lmv_get_export(lmv, och->och_fid);
+
+ RETURN(md_set_open_replay_data(tgt_exp, och, open_req));
}
int lmv_clear_open_replay_data(struct obd_export *exp,
{
struct obd_device *obd = exp->exp_obd;
struct lmv_obd *lmv = &obd->u.lmv;
+ struct obd_export *tgt_exp;
ENTRY;
- RETURN(md_clear_open_replay_data(lmv->tgts[0].ltd_exp, och));
+
+ tgt_exp = lmv_get_export(lmv, och->och_fid);
+
+ RETURN(md_clear_open_replay_data(tgt_exp, och));
}
struct obd_ops lmv_obd_ops = {