Whamcloud - gitweb
b=21949 echo code fixes.
authorVitaly Fertman <Vitaly.Fertman@sun.com>
Mon, 19 Apr 2010 23:29:21 +0000 (16:29 -0700)
committerRobert Read <robert.read@oracle.com>
Mon, 19 Apr 2010 23:34:17 +0000 (16:34 -0700)
i=eric.may
i=bzzz

1. access to a wrong page on echo server commit;
2. wrong lock type enqueue in echo client test_brw code;
3. wrong thread offset initialization in lctl test_brw code;

lustre/obdecho/echo.c
lustre/obdecho/echo_client.c
lustre/utils/obd.c

index 72fb655..67f018b 100644 (file)
@@ -530,8 +530,8 @@ commitrw_cleanup:
         CERROR("cleaning up %d pages (%d obdos)\n",
                niocount - pgs - 1, objcount);
 
-        while (pgs ++ < niocount) {
-                cfs_page_t *page = res[pgs].page;
+        while (pgs < niocount) {
+                cfs_page_t *page = res[pgs++].page;
 
                 if (page == NULL)
                         continue;
index 0cb20d9..237c146 100644 (file)
@@ -1157,7 +1157,7 @@ static int cl_echo_object_brw(struct echo_object *eco, int rw, obd_off offset,
 
         rc = cl_echo_enqueue0(env, eco, offset,
                               offset + npages * CFS_PAGE_SIZE - 1,
-                              rw == READ ? LCK_PW : LCK_PW, &lh.cookie,
+                              rw == READ ? LCK_PR : LCK_PW, &lh.cookie,
                               CEF_NEVER);
         if (rc < 0)
                 GOTO(error_lock, rc);
index 6e2a9b0..5e26909 100644 (file)
@@ -1636,7 +1636,7 @@ int jt_obd_test_brw(int argc, char **argv)
                         obj_idx = (thread - 1)/nthr_per_obj;
                         objid += obj_idx;
                         stride *= nthr_per_obj;
-                        if (thread == 1)
+                        if ((thread - 1) % nthr_per_obj == 0)
                                 shared_data->offsets[obj_idx] = stride + thr_offset;
                         thr_offset += ((thread - 1) % nthr_per_obj) * len;
                 } else {