ubifs: another scheduling while atomic back trace

Artem Bityutskiy dedekind at infradead.org
Thu Dec 18 08:53:38 EST 2008


On Thu, 2008-12-18 at 08:34 -0500, Cal Page wrote:
> I tracked it down to fs/ubifs/journal.c in make_reservation()?

How did you track? And what pointed you to this function?

> 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.


> Also, I notice fs/fs-writeback.c in writeback_inodes does a 
> down_read_trylock. Won't this interfear with the down_read above?

Sorry, I do not see how and what should interfere there.

-- 
Best regards,
Artem Bityutskiy (Битюцкий Артём)




More information about the linux-mtd mailing list