From 40d5c029b754adccc9260958715dd3449827ebd1 Mon Sep 17 00:00:00 2001 From: adilger Date: Wed, 2 Oct 2002 21:33:03 +0000 Subject: [PATCH] Fix breakage caused earlier this week by over-optimization. --- lustre/mds/mds_reint.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lustre/mds/mds_reint.c b/lustre/mds/mds_reint.c index bcb43ab..1f74047 100644 --- a/lustre/mds/mds_reint.c +++ b/lustre/mds/mds_reint.c @@ -412,6 +412,7 @@ static int mds_reint_unlink(struct mds_update_record *rec, int offset, struct dentry *dchild = NULL; struct mds_obd *mds = mds_req2mds(req); struct obd_device *obd = req->rq_export->exp_obd; + struct mds_body *body; char *name; struct inode *dir, *inode; struct lustre_handle lockh, child_lockh; @@ -453,6 +454,12 @@ static int mds_reint_unlink(struct mds_update_record *rec, int offset, GOTO(out_unlink_dchild, rc = -ENOENT); } + if (offset) { + body = lustre_msg_buf(req->rq_repmsg, offset); + mds_pack_inode2fid(&body->fid1, inode); + mds_pack_inode2body(body, inode); + } + OBD_FAIL_WRITE(OBD_FAIL_MDS_REINT_UNLINK_WRITE, dir->i_sb->s_dev); switch (rec->ur_mode /* & S_IFMT ? */) { @@ -465,14 +472,9 @@ static int mds_reint_unlink(struct mds_update_record *rec, int offset, case S_IFREG: /* get OBD EA data first so client can also destroy object */ if ((inode->i_mode & S_IFMT) == S_IFREG && offset) { - struct mds_body *body; struct lov_mds_md *lmm; - body = lustre_msg_buf(req->rq_repmsg, 1); - mds_pack_inode2fid(&body->fid1, inode); - mds_pack_inode2body(body, inode); - - lmm = lustre_msg_buf(req->rq_repmsg, 2); + lmm = lustre_msg_buf(req->rq_repmsg, offset + 1); lmm->lmm_easize = mds->mds_max_mdsize; if ((rc = mds_fs_get_md(mds, inode, lmm)) < 0) { CDEBUG(D_INFO, "No md for ino %ld: rc = %d\n", -- 1.8.3.1