Whamcloud - gitweb
- Fixes obdecho
authorpschwan <pschwan>
Thu, 13 Jun 2002 19:56:41 +0000 (19:56 +0000)
committerpschwan <pschwan>
Thu, 13 Jun 2002 19:56:41 +0000 (19:56 +0000)
- Fixes server-side write leaks
- removes ext2 and ext3 MDS module insertion from common.sh

lustre/obdclass/class_obd.c
lustre/osc/osc_request.c
lustre/ost/ost_handler.c
lustre/ptlrpc/niobuf.c
lustre/ptlrpc/rpc.c
lustre/tests/common.sh

index 178e74a..a747e85 100644 (file)
@@ -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));
index 444ff05..901cdbe 100644 (file)
@@ -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,
index bb5a214..6040e5c 100644 (file)
@@ -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)
index 1157920..3330dfb 100644 (file)
@@ -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);
index 861938d..220ab74 100644 (file)
@@ -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);
index f184982..dd2b36f 100644 (file)
@@ -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