From: rread Date: Tue, 20 Jul 2004 16:55:07 +0000 (+0000) Subject: b=3869 X-Git-Tag: 1.3.4~573 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=ba21f86c7cac34fe9275bd8fedc80d832c340154;p=fs%2Flustre-release.git b=3869 r=bzzz Reconstruct create reply for CROSS_REF directories from the dentry. --- diff --git a/lustre/mds/mds_internal.h b/lustre/mds/mds_internal.h index 385f471..27e7f53 100644 --- a/lustre/mds/mds_internal.h +++ b/lustre/mds/mds_internal.h @@ -123,6 +123,7 @@ int mds_get_md(struct obd_device *, struct inode *, void *md, int *size, int lock); 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_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 bc7717e..e5a591b 100644 --- a/lustre/mds/mds_lib.c +++ b/lustre/mds/mds_lib.c @@ -49,6 +49,14 @@ #include #include +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_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 e590380..80fe242 100644 --- a/lustre/mds/mds_reint.c +++ b/lustre/mds/mds_reint.c @@ -543,15 +543,20 @@ static void reconstruct_reint_create(struct mds_update_record *rec, int offset, LASSERT(!IS_ERR(parent)); child = ll_lookup_one_len(rec->ur_name, parent, rec->ur_namelen - 1); LASSERT(!IS_ERR(child)); - if (child->d_inode == NULL) { + if ((child->d_flags & DCACHE_CROSS_REF)) { + LASSERTF(child->d_inode == NULL, "BUG 3869"); + body = lustre_msg_buf(req->rq_repmsg, offset, sizeof (*body)); + mds_pack_dentry2fid(&body->fid1, child); + } 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, rec->ur_name, rec->ur_mode); LASSERTF(child->d_inode != NULL, "BUG 3869"); + } else { + body = lustre_msg_buf(req->rq_repmsg, offset, sizeof (*body)); + mds_pack_inode2fid(req2obd(req), &body->fid1, child->d_inode); + mds_pack_inode2body(req2obd(req), body, child->d_inode); } - body = lustre_msg_buf(req->rq_repmsg, offset, sizeof (*body)); - mds_pack_inode2fid(req2obd(req), &body->fid1, child->d_inode); - mds_pack_inode2body(req2obd(req), body, child->d_inode); l_dput(parent); l_dput(child); EXIT;