>From 7f305dbbe7cdb2ebfd410956f08ba4244ac578bd Mon Sep 17 00:00:00 2001 From: Jan Kara Date: Wed, 21 Jul 2010 20:56:21 +0200 Subject: [PATCH] Debug bit wait queues in JBD2. --- fs/jbd2/journal.c | 1 + kernel/wait.c | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index 0368808..0ecd858 100644 --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c @@ -2211,6 +2211,7 @@ restart: if (jinode->i_flags & JI_COMMIT_RUNNING) { wait_queue_head_t *wq; DEFINE_WAIT_BIT(wait, &jinode->i_flags, __JI_COMMIT_RUNNING); + wait.seen = 1; wq = bit_waitqueue(&jinode->i_flags, __JI_COMMIT_RUNNING); prepare_to_wait(wq, &wait.wait, TASK_UNINTERRUPTIBLE); spin_unlock(&journal->j_list_lock); diff --git a/kernel/wait.c b/kernel/wait.c index c4bd3d8..46acfae 100644 --- a/kernel/wait.c +++ b/kernel/wait.c @@ -177,8 +177,11 @@ int wake_bit_function(wait_queue_t *wait, unsigned mode, int sync, void *arg) = container_of(wait, struct wait_bit_queue, wait); if (wait_bit->key.flags != key->flags || - wait_bit->key.bit_nr != key->bit_nr || - test_bit(key->bit_nr, key->flags)) + wait_bit->key.bit_nr != key->bit_nr) + return 0; + if (wait_bit->seen == 1) + wait_bit->seen = 2 + test_bit(key->bit_nr, key->flags); + if (test_bit(key->bit_nr, key->flags)) return 0; else return autoremove_wake_function(wait, mode, sync, key); -- 1.6.4.2