fix pos_complete(), move to __trans_logger_ref_put()

unsure whether needed.

probably MANDATORY to avoid that replay symlinks could go ahead?
This commit is contained in:
Thomas Schoebel-Theuer 2012-02-08 16:44:53 +01:00 committed by Thomas Schoebel-Theuer
parent c320c67630
commit 4f2057bdca
2 changed files with 22 additions and 1 deletions

View File

@ -15,6 +15,7 @@
#define DELAY_CALLERS // this is _needed_
//#define WB_COPY // unnecessary (only costs performance)
//#define EARLY_COMPLETION
//#define OLD_POSCOMPLETE
// commenting this out is dangerous for data integrity! use only for testing!
#define USE_MEMCPY
@ -644,6 +645,9 @@ err:
return -EINVAL;
}
static noinline
void pos_complete(struct trans_logger_mref_aspect *orig_mref_a);
static noinline
void __trans_logger_ref_put(struct trans_logger_brick *brick, struct trans_logger_mref_aspect *mref_a)
{
@ -680,6 +684,13 @@ restart:
CHECK_HEAD_EMPTY(&mref_a->collect_head);
CHECK_HEAD_EMPTY(&mref_a->sub_list);
CHECK_HEAD_EMPTY(&mref_a->sub_head);
#ifndef OLD_POSCOMPLETE
if (mref_a->is_collected && likely(mref_a->wb_error >= 0)) {
pos_complete(mref_a);
}
#endif
CHECK_HEAD_EMPTY(&mref_a->pos_head);
if (shadow_a != mref_a) { // we are a slave shadow
@ -925,15 +936,24 @@ void free_writeback(struct writeback_info *wb)
orig_mref = orig_mref_a->object;
CHECK_ATOMIC(&orig_mref->ref_count, 1);
#if 1
if (unlikely(!orig_mref_a->is_collected)) {
MARS_ERR("request %lld (len = %d) was not collected\n", orig_mref->ref_pos, orig_mref->ref_len);
}
#ifdef OLD_POSCOMPLETE
while (!orig_mref_a->is_completed) {
MARS_ERR("request %lld (len = %d) was not completed, cleanup_count = %d\n", orig_mref->ref_pos, orig_mref->ref_len, cleanup_count);
msleep(3000);
}
#endif
#ifdef OLD_POSCOMPLETE
if (likely(wb->w_error >= 0)) {
pos_complete(orig_mref_a);
}
#else
if (unlikely(wb->w_error < 0)) {
orig_mref_a->wb_error = wb->w_error;
}
#endif
__trans_logger_ref_put(orig_mref_a->my_brick, orig_mref_a);
}

View File

@ -90,6 +90,7 @@ struct trans_logger_mref_aspect {
struct trans_logger_mref_aspect *orig_mref_a;
void *shadow_data;
int orig_rw;
int wb_error;
bool do_dealloc;
bool do_buffered;
bool is_hashed;