ubifs: another scheduling while atomic back trace
I tracked it down to fs/ubifs/journal.c in make_reservation()?
the code is:
again:
down_read()
err = reserve_space()
if ( !err) return 0
up_read()
shouldn't we to the up as part of the if? ie
if ( !err ) { up_read(); return 0; };Also, I notice fs/fs-writeback.c in writeback_inodes does a down_read_trylock. Won't this interfear with the down_read above?
Cal Page
Quoted 1 line · Cal Page
I tracked it down to
fs/ubifs/journal.cinmake_reservation()?
How did you track? And what pointed you to this function?
Quoted 6 lines
the code is:
again:
down_read()
err =reserve_space()
if ( !err) return 0
up_read()
That code really looks hacky, because it takes the lock and assumes the caller unlocks it. We tried to come up with a better solution, and debated on this, but concluded that this is the best way.
IOW, this is fine, because the caller unlocks the lock using 'finish_reservation()' call.
Moreover, rw semaphore should not make the code to be atomic.
Quoted 2 lines
Also, I notice
fs/fs-writeback.cinwriteback_inodesdoes adown_read_trylock. Won't this interfear with thedown_readabove?
Sorry, I do not see how and what should interfere there.
Signature · 2 lines
Best regards, Artem Bityutskiy (Битюцкий Артём)