Whamcloud - gitweb
- small fixes; things work.
authorbraam <braam>
Sun, 3 Mar 2002 07:46:16 +0000 (07:46 +0000)
committerbraam <braam>
Sun, 3 Mar 2002 07:46:16 +0000 (07:46 +0000)
lustre/osc/osc_request.c
lustre/ost/ost_handler.c

index 828f83b..642751b 100644 (file)
@@ -428,7 +428,7 @@ int osc_brw_write(struct obd_conn *conn, obd_count num_oa, struct obdo **oa,
        }
 
         OBD_ALLOC(src, size2);
-        if (src) { 
+        if (!src) { 
                 CERROR("no src memory\n");
                 return -ENOMEM;
         }
@@ -479,7 +479,7 @@ int osc_brw_write(struct obd_conn *conn, obd_count num_oa, struct obdo **oa,
                        n++;
                }
        }
-
+        OBD_FREE(src); 
  out:
        if (request->rq_rephdr)
                OBD_FREE(request->rq_rephdr, request->rq_replen);
index 920746b..cdd5245 100644 (file)
@@ -269,7 +269,7 @@ static int ost_brw_read(struct ost_obd *obddev, struct ptlrpc_request *req)
        char *tmp1, *tmp2, *end2;
        char *res = NULL;
        int cmd;
-       struct niobuf *nb, *src;
+       struct niobuf *nb, *src, *dst;
        struct obd_ioobj *ioo;
        struct ost_req *r = req->rq_req.ost;
 
@@ -329,9 +329,9 @@ static int ost_brw_read(struct ost_obd *obddev, struct ptlrpc_request *req)
                         goto out;
                 }
 
-                src = &((struct niobuf *)tmp2)[i];
-
-                bulk->b_xid = src->xid;
+                src = &((struct niobuf *)res)[i];
+                dst = &((struct niobuf *)tmp2)[i];
+                bulk->b_xid = dst->xid;
                 bulk->b_buf = (void *)(unsigned long)src->addr;
                 bulk->b_buflen = PAGE_SIZE;
                 rc = ptlrpc_send_bulk(bulk, OST_BULK_PORTAL);