[PATCH] ext4: Debug sleepers in iput()

From: Jan Kara
Date: Tue Mar 31 2009 - 05:57:10 EST


Signed-off-by: Jan Kara <jack@xxxxxxx>
---
fs/jbd2/commit.c | 4 ++++
fs/jbd2/journal.c | 6 ++++++
2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c
index 62804e5..f47b8a3 100644
--- a/fs/jbd2/commit.c
+++ b/fs/jbd2/commit.c
@@ -259,6 +259,8 @@ static int journal_submit_data_buffers(journal_t *journal,
spin_lock(&journal->j_list_lock);
J_ASSERT(jinode->i_transaction == commit_transaction);
jinode->i_flags &= ~JI_COMMIT_RUNNING;
+ if (jinode->i_flags & 4)
+ printk(KERN_INFO "JBD2: Waking up sleeper on ino %lu\n", jinode->i_vfs_inode->i_ino);
wake_up_bit(&jinode->i_flags, __JI_COMMIT_RUNNING);
}
spin_unlock(&journal->j_list_lock);
@@ -296,6 +298,8 @@ static int journal_finish_inode_data_buffers(journal_t *journal,
}
spin_lock(&journal->j_list_lock);
jinode->i_flags &= ~JI_COMMIT_RUNNING;
+ if (jinode->i_flags & 4)
+ printk(KERN_INFO "JBD2: Waking up sleeper on ino %lu\n", jinode->i_vfs_inode->i_ino);
wake_up_bit(&jinode->i_flags, __JI_COMMIT_RUNNING);
}

diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
index 5814410..5459fd9 100644
--- a/fs/jbd2/journal.c
+++ b/fs/jbd2/journal.c
@@ -2225,11 +2225,17 @@ restart:
if (jinode->i_flags & JI_COMMIT_RUNNING) {
wait_queue_head_t *wq;
DEFINE_WAIT_BIT(wait, &jinode->i_flags, __JI_COMMIT_RUNNING);
+ unsigned long ino = jinode->i_vfs_inode->i_ino;
+
+ jinode->i_flags |= 4;
+ printk(KERN_INFO "JBD2: Waiting for ino %lu\n", ino);
+
wq = bit_waitqueue(&jinode->i_flags, __JI_COMMIT_RUNNING);
prepare_to_wait(wq, &wait.wait, TASK_UNINTERRUPTIBLE);
spin_unlock(&journal->j_list_lock);
schedule();
finish_wait(wq, &wait.wait);
+ printk(KERN_INFO "JBD2: Woken on ino %lu\n", ino);
goto restart;
}

--
1.6.0.2


--d6Gm4EdcadzBjdND--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/