Skip to contentSkip to conversation

a suspected bug at let_transaction_grow()

DISCUSSION 홍신 shin hong 1 participant 1 message Sep 1, 2009

lore
Share & tools
lore
#0 lore raw

Hi. I would like to report a suspected bug at let_transaction_grow() in fs/reiserfs/journal.c of Linux 2.6.30.4.

I found this suspected bug while I survey the usage of atomic instruction and memory barriers. I am not certain whether this report is real or not since I do not have ReiserFS background. But I hope that this report is helpful. Please examine the report and let me know your opinion.

In let_transaction_grow(), I found the following code for busy-waiting:

	while ((atomic_read(&journal->j_wcount) > 0 ||
                  atomic_read(&journal->j_jlock)) &&
                  journal->j_trans_id == trans_id) {
	    queue_log_writer(sb);
	}

However, it may result starvation(or infinite loop) since there is no memory barrier for atomic_read()
(atomic_read() may read out-of-dates value).

Thank you.

Sincerely
Shin Hong