#define DEBUG_SUBSYSTEM S_MDS
#include <linux/kthread.h>
+#include <linux/delay.h>
#include <lustre_log.h>
#include <lustre_update.h>
#include "osp_internal.h"
struct llog_ctxt *ctxt;
struct llog_handle *llh;
int *arr;
- struct list_head list, *le;
+ LIST_HEAD(list);
+ struct list_head *le;
struct llog_logid lgid;
int rc, i, count = 0, done = 0;
llh = ctxt->loc_handle;
LASSERT(llh);
- INIT_LIST_HEAD(&list);
spin_lock(&d->opd_sync_lock);
list_splice(&d->opd_sync_committed_there, &list);
INIT_LIST_HEAD(&d->opd_sync_committed_there);
llh = NULL;
rec = NULL;
}
+ if (OBD_FAIL_PRECHECK(OBD_FAIL_CATALOG_FULL_CHECK) &&
+ cfs_fail_val != 1)
+ msleep(1 * MSEC_PER_SEC);
wait_event_idle(d->opd_sync_waitq,
!osp_sync_running(d) ||
{
struct osp_device *d = _arg;
struct ptlrpc_thread *thread = &d->opd_sync_thread;
- struct l_wait_info lwi = { 0 };
struct llog_ctxt *ctxt;
struct obd_device *obd = d->opd_obd;
struct llog_handle *llh;
/* processing reaches catalog bottom */
if (d->opd_sync_last_catalog_idx == size)
d->opd_sync_last_catalog_idx = LLOG_CAT_FIRST;
- else if (wrapped)
- /* If catalog is wrapped we can`t predict last index of
- * processing because lgh_last_idx could be changed.
- * Starting form the next one */
- d->opd_sync_last_catalog_idx++;
-
+ /* If catalog is wrapped we can`t predict last index of
+ * processing because lgh_last_idx could be changed.
+ * Starting form the next one. Index would be increased
+ * at llog_process_thread
+ */
} while (rc == 0 && (wrapped ||
d->opd_sync_last_catalog_idx == LLOG_CAT_FIRST));
while (atomic_read(&d->opd_sync_rpcs_in_progress) > 0) {
osp_sync_process_committed(&env, d);
- lwi = LWI_TIMEOUT(cfs_time_seconds(5), NULL, NULL);
- rc = l_wait_event(d->opd_sync_waitq,
- atomic_read(&d->opd_sync_rpcs_in_progress) == 0,
- &lwi);
- if (rc == -ETIMEDOUT)
+ rc = wait_event_idle_timeout(
+ d->opd_sync_waitq,
+ atomic_read(&d->opd_sync_rpcs_in_progress) == 0,
+ cfs_time_seconds(5));
+ if (rc == 0)
count++;
LASSERTF(count < 10, "%s: %d %d %sempty\n",
d->opd_obd->obd_name,