Thread (33 messages) 33 messages, 6 authors, 2008-08-21

Re: [PATCH] jbd jbd2: fix dio write returningEIOwhentry_to_release_page fails

From: Hisashi Hifumi <hidden>
Date: 2008-08-06 08:39:28
Also in: linux-fsdevel

quoted hunk ↗ jump to hunk
I modified my patch.
I do not change Checking b_count in a loop, but introduce 
set_current_state(TASK_UNINTERRUPTIBLE) to mitigate the loop. I think this can 
lead to avoid busy loop.
I used the same approach of do_sync_read()->wait_on_retry_sync_kiocb or 
some drivers(qla2xxx).

Signed-off-by: Hisashi Hifumi <redacted>

diff -Nrup linux-2.6.27-rc1.org/fs/jbd/transaction.c 
linux-2.6.27-rc1.jbdfix/fs/jbd/transaction.c
--- linux-2.6.27-rc1.org/fs/jbd/transaction.c	2008-07-29 19:28:47.000000000 +0900
+++ linux-2.6.27-rc1.jbdfix/fs/jbd/transaction.c	2008-08-06 
13:35:37.000000000 +0900
@@ -1764,6 +1764,15 @@ int journal_try_to_free_buffers(journal_
	*/
	if (ret == 0 && (gfp_mask & __GFP_WAIT) && (gfp_mask & __GFP_FS)) {
		journal_wait_for_transaction_sync_data(journal);
+
+		bh = head;
+		do {
+			while (atomic_read(&bh->b_count)) {
+				set_current_state(TASK_UNINTERRUPTIBLE);
+				schedule();
+				__set_current_state(TASK_RUNNING);
+			}
+		} while ((bh = bh->b_this_page) != head);
		ret = try_to_free_buffers(page);
	}
Sorry, the thread entering this loop sleeps infinitely.
We should add some wait queue and implement wait/wakeup code.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help