From 10cd01ded389754532a3cdc96f4ae5d63149713f Mon Sep 17 00:00:00 2001 From: pschwan Date: Thu, 13 Jun 2002 19:56:41 +0000 Subject: [PATCH] - Fixes obdecho - Fixes server-side write leaks - removes ext2 and ext3 MDS module insertion from common.sh --- lustre/obdclass/class_obd.c | 5 +++-- lustre/osc/osc_request.c | 2 ++ lustre/ost/ost_handler.c | 6 ++++++ lustre/ptlrpc/niobuf.c | 2 ++ lustre/ptlrpc/rpc.c | 3 +++ lustre/tests/common.sh | 4 ++-- 6 files changed, 18 insertions(+), 4 deletions(-) diff --git a/lustre/obdclass/class_obd.c b/lustre/obdclass/class_obd.c index 178e74a..a747e85 100644 --- a/lustre/obdclass/class_obd.c +++ b/lustre/obdclass/class_obd.c @@ -515,8 +515,9 @@ static int obd_class_ioctl (struct inode * inode, struct file * filp, EXIT; brw_cleanup: - while (pages-- > 0) - __free_pages(bufs[pages], 0); + i = pages; + while (i-- > 0) + __free_pages(bufs[i], 0); brw_free: OBD_FREE(bufs, pages * sizeof(*bufs)); OBD_FREE(counts, pages * sizeof(*counts)); diff --git a/lustre/osc/osc_request.c b/lustre/osc/osc_request.c index 444ff05..901cdbe 100644 --- a/lustre/osc/osc_request.c +++ b/lustre/osc/osc_request.c @@ -469,6 +469,7 @@ static void brw_write_finish(struct ptlrpc_bulk_desc *desc, void *data) { struct osc_brw_cb_data *cb_data = data; int i; + ENTRY; if (desc->b_flags & PTL_RPC_FL_INTR) CERROR("got signal\n"); @@ -482,6 +483,7 @@ static void brw_write_finish(struct ptlrpc_bulk_desc *desc, void *data) ptlrpc_free_req(cb_data->req); OBD_FREE(cb_data, sizeof(*cb_data)); + EXIT; } static int osc_brw_write(struct obd_conn *conn, obd_count num_oa, diff --git a/lustre/ost/ost_handler.c b/lustre/ost/ost_handler.c index bb5a214..6040e5c 100644 --- a/lustre/ost/ost_handler.c +++ b/lustre/ost/ost_handler.c @@ -319,6 +319,10 @@ static int ost_brw_read(struct ost_obd *obddev, struct ptlrpc_request *req) if (rc) GOTO(out_bulk, rc); + wait_event_interruptible(desc->b_waitq, ptlrpc_check_bulk_sent(desc)); + if (desc->b_flags & PTL_RPC_FL_INTR) + rc = -EINTR; + /* The unpackers move tmp1 and tmp2, so reset them before using */ tmp1 = lustre_msg_buf(req->rq_reqmsg, 1); tmp2 = lustre_msg_buf(req->rq_reqmsg, 2); @@ -358,7 +362,9 @@ static int ost_brw_write_cb(struct ptlrpc_bulk_page *bulk) static void ost_brw_write_finished_cb(struct ptlrpc_bulk_desc *desc, void *data) { + ENTRY; ptlrpc_free_bulk(desc); + EXIT; } static int ost_brw_write(struct ost_obd *obddev, struct ptlrpc_request *req) diff --git a/lustre/ptlrpc/niobuf.c b/lustre/ptlrpc/niobuf.c index 1157920..3330dfb 100644 --- a/lustre/ptlrpc/niobuf.c +++ b/lustre/ptlrpc/niobuf.c @@ -158,6 +158,8 @@ int ptlrpc_register_bulk(struct ptlrpc_bulk_desc *desc) int rc; ENTRY; + atomic_set(&desc->b_finished_count, desc->b_page_count); + list_for_each_safe(tmp, next, &desc->b_page_list) { struct ptlrpc_bulk_page *bulk; bulk = list_entry(tmp, struct ptlrpc_bulk_page, b_link); diff --git a/lustre/ptlrpc/rpc.c b/lustre/ptlrpc/rpc.c index 861938d..220ab74 100644 --- a/lustre/ptlrpc/rpc.c +++ b/lustre/ptlrpc/rpc.c @@ -144,6 +144,9 @@ static void __exit ptlrpc_exit(void) ptlrpc_cleanup_connection(); } +/* events.c */ +EXPORT_SYMBOL(ptlrpc_check_bulk_sent); + /* connmgr.c */ EXPORT_SYMBOL(ptlrpc_connmgr); EXPORT_SYMBOL(connmgr_connect); diff --git a/lustre/tests/common.sh b/lustre/tests/common.sh index f184982..dd2b36f 100644 --- a/lustre/tests/common.sh +++ b/lustre/tests/common.sh @@ -199,8 +199,8 @@ setup_lustre() { do_insmod $LUSTRE/extN/extN.o || \ echo "info: can't load extN.o module, not fatal if using ext3" do_insmod $LUSTRE/mds/mds.o || exit -1 - do_insmod $LUSTRE/mds/mds_ext2.o || exit -1 - do_insmod $LUSTRE/mds/mds_ext3.o || exit -1 + #do_insmod $LUSTRE/mds/mds_ext2.o || exit -1 + #do_insmod $LUSTRE/mds/mds_ext3.o || exit -1 do_insmod $LUSTRE/mds/mds_extN.o || \ echo "info: can't load mds_extN.o module, needs extN.o" do_insmod $LUSTRE/obdecho/obdecho.o || exit -1 -- 1.8.3.1