From f887b81eefa72bf6148f59a0101201d9c14e70e3 Mon Sep 17 00:00:00 2001 From: braam Date: Fri, 1 Feb 2002 18:18:06 +0000 Subject: [PATCH] Minor bugfix to allow multiple networked operations: - small fix to avoid crash in getattr - properly unlink MDs and MEs after we send buffers - fixups to the test scripts --- lustre/include/linux/lustre_net.h | 1 + lustre/llite/namei.c | 2 +- lustre/ptlrpc/rpc.c | 8 ++++---- lustre/tests/llmount.sh | 5 +---- lustre/tests/mdcreqcleanup.sh | 2 +- 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/lustre/include/linux/lustre_net.h b/lustre/include/linux/lustre_net.h index f403154..4c3b375 100644 --- a/lustre/include/linux/lustre_net.h +++ b/lustre/include/linux/lustre_net.h @@ -74,6 +74,7 @@ struct ptlrpc_request { wait_queue_head_t rq_wait_for_rep; ptl_md_t rq_reply_md; + ptl_handle_md_t rq_reply_md_h; ptl_md_t rq_req_md; __u32 rq_reply_portal; __u32 rq_req_portal; diff --git a/lustre/llite/namei.c b/lustre/llite/namei.c index afb5b14..01df8cb 100644 --- a/lustre/llite/namei.c +++ b/lustre/llite/namei.c @@ -95,7 +95,7 @@ static struct dentry *ll_lookup(struct inode * dir, struct dentry *dentry) if (!ino) goto negative; - sbi = (struct ll_sb_info *)(&dentry->d_inode->i_sb->u.generic_sbp); + sbi = (struct ll_sb_info *)(&dir->i_sb->u.generic_sbp); err = mdc_getattr(sbi->ll_peer_ptr, ino, type, OBD_MD_FLNOTOBD|OBD_MD_FLBLOCKS, &rep, &hdr); diff --git a/lustre/ptlrpc/rpc.c b/lustre/ptlrpc/rpc.c index f529207..9c0e38a 100644 --- a/lustre/ptlrpc/rpc.c +++ b/lustre/ptlrpc/rpc.c @@ -105,7 +105,6 @@ int ptl_send_buf(struct ptlrpc_request *request, struct lustre_peer *peer, int ptl_send_rpc(struct ptlrpc_request *request, struct lustre_peer *peer) { - ptl_handle_md_t reply_md_h; ptl_handle_me_t me_h; ptl_process_id_t local_id; int rc; @@ -123,7 +122,7 @@ int ptl_send_rpc(struct ptlrpc_request *request, struct lustre_peer *peer) local_id.rid = PTL_ID_ANY; rc = PtlMEAttach(peer->peer_ni, request->rq_reply_portal, local_id, - request->rq_xid, 0, PTL_RETAIN, &me_h); + request->rq_xid, 0, PTL_UNLINK, &me_h); if (rc != PTL_OK) { EXIT; /* FIXME: tear down EQ, free reqbuf */ @@ -132,12 +131,13 @@ int ptl_send_rpc(struct ptlrpc_request *request, struct lustre_peer *peer) request->rq_reply_md.start = request->rq_repbuf; request->rq_reply_md.length = request->rq_replen; - request->rq_reply_md.threshold = PTL_MD_THRESH_INF; + request->rq_reply_md.threshold = 1; request->rq_reply_md.options = PTL_MD_OP_PUT; request->rq_reply_md.user_ptr = request; request->rq_reply_md.eventq = req_eq; - rc = PtlMDAttach(me_h, request->rq_reply_md, PTL_RETAIN, &reply_md_h); + rc = PtlMDAttach(me_h, request->rq_reply_md, PTL_UNLINK, + &request->rq_reply_md_h); if (rc != PTL_OK) { EXIT; return rc; diff --git a/lustre/tests/llmount.sh b/lustre/tests/llmount.sh index 9499617..f119e03 100755 --- a/lustre/tests/llmount.sh +++ b/lustre/tests/llmount.sh @@ -52,7 +52,4 @@ quit EOF mkdir /mnt/obd -mount -t lustre_light -o device=3 none /mnt/obd - - - +# mount -t lustre_light -o device=3 none /mnt/obd diff --git a/lustre/tests/mdcreqcleanup.sh b/lustre/tests/mdcreqcleanup.sh index 8096a03..033ec8d 100755 --- a/lustre/tests/mdcreqcleanup.sh +++ b/lustre/tests/mdcreqcleanup.sh @@ -9,7 +9,7 @@ EOF rmmod mds rmmod osc rmmod ost -rmmod obext2 +rmmod obdext2 rmmod obdclass rmmod ptlrpc /usr/src/portals/linux/utils/ptlctl <