From 4176fa0970c9a86f6438a23b1ff3ff2edd2fb96f Mon Sep 17 00:00:00 2001 From: rread Date: Thu, 22 Jul 2004 06:36:02 +0000 Subject: [PATCH] b=3940 Corrected. OBD_MD_MDS should only be set when the directory was created on a different node. --- lustre/mds/mds_internal.h | 1 + lustre/mds/mds_lib.c | 11 +++++++++-- lustre/mds/mds_reint.c | 2 ++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/lustre/mds/mds_internal.h b/lustre/mds/mds_internal.h index 0f3a091..d29398f 100644 --- a/lustre/mds/mds_internal.h +++ b/lustre/mds/mds_internal.h @@ -124,6 +124,7 @@ int mds_get_md(struct obd_device *, struct inode *, void *md, int *size, int mds_pack_md(struct obd_device *, struct lustre_msg *, int offset, struct mds_body *, struct inode *, int lock); void mds_pack_dentry2fid(struct ll_fid *, struct dentry *); +void mds_pack_dentry2body(struct mds_body *b, struct dentry *dentry); void mds_pack_inode2fid(struct obd_device *, struct ll_fid *, struct inode *); void mds_pack_inode2body(struct obd_device *, struct mds_body *, struct inode *); #endif diff --git a/lustre/mds/mds_lib.c b/lustre/mds/mds_lib.c index e5a591b..ced2a70 100644 --- a/lustre/mds/mds_lib.c +++ b/lustre/mds/mds_lib.c @@ -49,14 +49,21 @@ #include #include -void mds_pack_dentry2fid(struct ll_fid *fid, - struct dentry *dentry) +void mds_pack_dentry2fid(struct ll_fid *fid, struct dentry *dentry) { fid->id = dentry->d_inum; fid->generation = dentry->d_generation; fid->mds = dentry->d_mdsnum; } +void mds_pack_dentry2body(struct mds_body *b, struct dentry *dentry) +{ + b->valid |= OBD_MD_FLID | OBD_MD_FLGENER; + b->ino = dentry->d_inum; + b->generation = dentry->d_generation; + b->mds = dentry->d_mdsnum; +} + void mds_pack_inode2fid(struct obd_device *obd, struct ll_fid *fid, struct inode *inode) { diff --git a/lustre/mds/mds_reint.c b/lustre/mds/mds_reint.c index 3689a10..e049a1f 100644 --- a/lustre/mds/mds_reint.c +++ b/lustre/mds/mds_reint.c @@ -547,6 +547,8 @@ static void reconstruct_reint_create(struct mds_update_record *rec, int offset, LASSERTF(child->d_inode == NULL, "BUG 3869"); body = lustre_msg_buf(req->rq_repmsg, offset, sizeof (*body)); mds_pack_dentry2fid(&body->fid1, child); + mds_pack_dentry2body(body, child); + body->valid |= OBD_MD_MDS; } else if (child->d_inode == NULL) { DEBUG_REQ(D_ERROR, req, "parent "LPU64"/%u name %s mode %o", rec->ur_fid1->id, rec->ur_fid1->generation, -- 1.8.3.1