all: testing of hangs

This commit is contained in:
Thomas Schoebel-Theuer 2016-08-08 13:47:25 +02:00
parent 90653476f6
commit 634499d3d2
7 changed files with 27 additions and 0 deletions

View File

@ -466,6 +466,7 @@ extern void mref_checksum(struct mref_object *mref);
#ifdef CONFIG_MARS_DEBUG
extern int mars_crash_mode;
extern int mars_hang_mode;
extern void _crashme(int mode, bool do_sync);
#else
extern inline void _crashme(int mode, bool do_sync) {}

View File

@ -654,6 +654,13 @@ static int aio_event_thread(void *data)
break;
}
#ifdef CONFIG_MARS_DEBUG
if (mars_hang_mode & 1) {
brick_msleep(100);
continue;
}
#endif
oldfs = get_fs();
set_fs(get_ds());
/* TODO: don't timeout upon termination.

View File

@ -545,6 +545,12 @@ int bio_response_thread(void *data)
atomic_read(&brick->fly_count[1]),
atomic_read(&brick->fly_count[2]));
#ifdef CONFIG_MARS_DEBUG
if (mars_hang_mode & 2) {
brick_msleep(100);
continue;
}
#endif
spin_lock_irqsave(&brick->lock, flags);
list_replace_init(&brick->completed_list, &tmp_list);
spin_unlock_irqrestore(&brick->lock, flags);

View File

@ -350,6 +350,11 @@ void _complete(struct sio_output *output, struct mref_object *mref, int err)
mref->ref_flags |= MREF_UPTODATE;
}
#ifdef CONFIG_MARS_DEBUG
while (mars_hang_mode & 1)
brick_msleep(100);
#endif
CHECKED_CALLBACK(mref, err, err_found);
done:

View File

@ -184,6 +184,8 @@ EXPORT_SYMBOL_GPL(mars_keep_msg);
int mars_crash_mode = 0;
EXPORT_SYMBOL_GPL(mars_crash_mode);
int mars_hang_mode = 0;
EXPORT_SYMBOL_GPL(mars_hang_mode);
void _crashme(int mode, bool do_sync)
{

View File

@ -294,6 +294,7 @@ ctl_table mars_table[] = {
INT_ENTRY("aio_sync_mode", aio_sync_mode, 0600),
#ifdef CONFIG_MARS_DEBUG
INT_ENTRY("debug_crash_mode", mars_crash_mode, 0600),
INT_ENTRY("debug_hang_mode", mars_hang_mode, 0600),
#endif
INT_ENTRY("logger_completion_semantics", trans_logger_completion_semantics, 0600),
INT_ENTRY("logger_do_crc", trans_logger_do_crc, 0600),

View File

@ -221,6 +221,11 @@ int mars_symlink(const char *oldpath, const char *newpath, const struct timespec
else
get_lamport(&times[0]);
#ifdef CONFIG_MARS_DEBUG
while (mars_hang_mode & 4)
brick_msleep(100);
#endif
oldfs = get_fs();
set_fs(get_ds());
/* Some filesystems have only full second resolution.