From: Vitaly Fertman Date: Mon, 19 Apr 2010 23:29:21 +0000 (-0700) Subject: b=21949 echo code fixes. X-Git-Tag: 1.10.0.41~40 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=f1877b1a9b1c988554589189a11af698fe22b254 b=21949 echo code fixes. 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; --- diff --git a/lustre/obdecho/echo.c b/lustre/obdecho/echo.c index 72fb655..67f018b 100644 --- a/lustre/obdecho/echo.c +++ b/lustre/obdecho/echo.c @@ -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; diff --git a/lustre/obdecho/echo_client.c b/lustre/obdecho/echo_client.c index 0cb20d9..237c146 100644 --- a/lustre/obdecho/echo_client.c +++ b/lustre/obdecho/echo_client.c @@ -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); diff --git a/lustre/utils/obd.c b/lustre/utils/obd.c index 6e2a9b0..5e26909 100644 --- a/lustre/utils/obd.c +++ b/lustre/utils/obd.c @@ -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 {