From 8d3841ca58d133bc1b2cce19dc89d315572bae51 Mon Sep 17 00:00:00 2001 From: phil Date: Fri, 24 Oct 2003 18:35:08 +0000 Subject: [PATCH] b=2029 r=adilger - abstracts multiple copies of code into mds_open_by_fid - abstract some conditions and transaction mechanisms into mds_create_objects - as a temporary measure, take the inode-reuse lock in mds_open - fixes a bug introduced by pre-creation, where two MDS threads could race to create objects on the same inode; fixed by moving the i_sem out of fsfilt_get_md and around the entire operation --- lustre/mds/mds_internal.h | 2 ++ lustre/mds/mds_unlink_open.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lustre/mds/mds_internal.h b/lustre/mds/mds_internal.h index 472c49e..1c3aa7f 100644 --- a/lustre/mds/mds_internal.h +++ b/lustre/mds/mds_internal.h @@ -87,6 +87,8 @@ extern struct lvfs_callback_ops mds_lvfs_ops; extern int mds_iocontrol(unsigned int cmd, struct obd_export *exp, int len, void *karg, void *uarg); #ifdef __KERNEL__ +int mds_pack_md(struct obd_device *, struct lustre_msg *, int offset, + struct mds_body *, struct inode *, int lock); void mds_pack_inode2fid(struct ll_fid *fid, struct inode *inode); void mds_pack_inode2body(struct mds_body *body, struct inode *inode); #endif diff --git a/lustre/mds/mds_unlink_open.c b/lustre/mds/mds_unlink_open.c index 6fb4ba1..6116010 100644 --- a/lustre/mds/mds_unlink_open.c +++ b/lustre/mds/mds_unlink_open.c @@ -190,7 +190,7 @@ static int mds_unlink(struct obd_device *obd, struct dentry *dchild, LASSERT(body != NULL); mds_pack_inode2body(body, inode); - mds_pack_md(obd, req->rq_repmsg, 1, body, inode); + mds_pack_md(obd, req->rq_repmsg, 1, body, inode, 1); handle = fsfilt_start(obd, pending_dir, FSFILT_OP_UNLINK_LOG, NULL); if (IS_ERR(handle)) { -- 1.8.3.1