- reset crpc_bulk.bk_pages should happen after brw_check_bulk is done.
#ifdef __KERNEL__
pg = bk->bk_iovs[i].kiov_page;
#else
#ifdef __KERNEL__
pg = bk->bk_iovs[i].kiov_page;
#else
+ LASSERT (bk->bk_pages != NULL);
pg = bk->bk_pages[i];
#endif
brw_fill_page(pg, pattern, magic);
pg = bk->bk_pages[i];
#endif
brw_fill_page(pg, pattern, magic);
#ifdef __KERNEL__
pg = bk->bk_iovs[i].kiov_page;
#else
#ifdef __KERNEL__
pg = bk->bk_iovs[i].kiov_page;
#else
+ LASSERT (bk->bk_pages != NULL);
pg = bk->bk_pages[i];
#endif
if (brw_check_page(pg, pattern, magic) != 0) {
pg = bk->bk_pages[i];
#endif
if (brw_check_page(pg, pattern, magic) != 0) {
-#ifndef __KERNEL__
- rpc->crpc_bulk.bk_pages = NULL;
-#endif
-
if (rpc->crpc_status != 0) {
CERROR ("BRW RPC to %s failed with %d\n",
libcfs_id2str(rpc->crpc_dest), rpc->crpc_status);
if (rpc->crpc_status != 0) {
CERROR ("BRW RPC to %s failed with %d\n",
libcfs_id2str(rpc->crpc_dest), rpc->crpc_status);
}
if (msg->msg_magic != SRPC_MSG_MAGIC) {
}
if (msg->msg_magic != SRPC_MSG_MAGIC) {
if (reply->brw_status != 0) {
atomic_inc(&sn->sn_brw_errors);
if (reply->brw_status != 0) {
atomic_inc(&sn->sn_brw_errors);
- if (reqst->brw_rw == LST_BRW_WRITE) return;
+ if (reqst->brw_rw == LST_BRW_WRITE) goto out;
if (brw_check_bulk(&rpc->crpc_bulk, reqst->brw_flags, magic) != 0) {
CERROR ("Bulk data from %s is corrupted!\n",
if (brw_check_bulk(&rpc->crpc_bulk, reqst->brw_flags, magic) != 0) {
CERROR ("Bulk data from %s is corrupted!\n",
atomic_inc(&sn->sn_brw_errors);
}
atomic_inc(&sn->sn_brw_errors);
}
+out:
+#ifndef __KERNEL__
+ rpc->crpc_bulk.bk_pages = NULL;
+#endif
struct list_head stt_hash[STTIMER_NSLOTS];
int stt_shuttingdown;
#ifdef __KERNEL__
struct list_head stt_hash[STTIMER_NSLOTS];
int stt_shuttingdown;
#ifdef __KERNEL__
int stt_nthreads;
#endif
} stt_data;
int stt_nthreads;
#endif
} stt_data;
while (!stt_data.stt_shuttingdown) {
stt_check_timers(&stt_data.stt_prev_slot);
while (!stt_data.stt_shuttingdown) {
stt_check_timers(&stt_data.stt_prev_slot);
- set_current_state(CFS_TASK_INTERRUPTIBLE);
- cfs_schedule_timeout(CFS_TASK_INTERRUPTIBLE,
- cfs_time_seconds(STTIMER_SLOTTIME));
+ wait_event_timeout(stt_data.stt_waitq,
+ stt_data.stt_shuttingdown,
+ cfs_time_seconds(STTIMER_SLOTTIME));
}
spin_lock(&stt_data.stt_lock);
}
spin_lock(&stt_data.stt_lock);
#ifdef __KERNEL__
stt_data.stt_nthreads = 0;
#ifdef __KERNEL__
stt_data.stt_nthreads = 0;
+ cfs_waitq_init(&stt_data.stt_waitq);
rc = stt_start_timer_thread();
if (rc != 0)
rc = stt_start_timer_thread();
if (rc != 0)
- CERROR ("Can't spawn timer, stt_startup() has failed: %d\n", rc);
+ CERROR ("Can't spawn timer thread: %d\n", rc);
stt_data.stt_shuttingdown = 1;
#ifdef __KERNEL__
stt_data.stt_shuttingdown = 1;
#ifdef __KERNEL__
+ cfs_waitq_signal(&stt_data.stt_waitq);
lst_wait_until(stt_data.stt_nthreads == 0, stt_data.stt_lock,
"waiting for %d threads to terminate\n",
stt_data.stt_nthreads);
lst_wait_until(stt_data.stt_nthreads == 0, stt_data.stt_lock,
"waiting for %d threads to terminate\n",
stt_data.stt_nthreads);