[PATCH v2] UBIFS: Fix assert failed in ubifs_set_page_dirty

hujianyang hujianyang at huawei.com
Sat May 3 23:38:35 PDT 2014

Hi, Dolev

On 2014/4/30 21:48, Dolev Raviv wrote:
> Hi Hujianyang and Laurence,
> I'm hitting an assertion in very similar code during the callback
> ubifs_releasepage(). I'm quite new to this code area, and currently diving
> in to understanding the race you described (before I attempt to look at
> the patch).
> I was wondering if this assertion is related?
> [  862.695278] UBIFS assert failed in ubifs_releasepage at 1434 (pid 11088)

What's your kernel version? Because in v3.15 and v3.10, line 1434
present different assertion.

I think you probably hit:


static int ubifs_releasepage(struct page *page, gfp_t unused_gfp_flags)
         * An attempt to release a dirty page without budgeting for it - should
         * not happen.
        if (PageWriteback(page))
                return 0;
        ubifs_assert(0);                          <- v3.10 line 1434
        return 1;

Page_Private bit seems to indicate page is budgeted in UBIFS. Dropping
caches performs with page lock and just deals with pages which are not
dirty. Then, if page_private bit is set, vfs performs ->releasepage at

Maybe some explanation of this assert failed is that there is a private
(budgeted) but not dirty page in your page caches.

I think it is not related to my race because pages can just remain
in 3 states at fsync and mmap:

1) Dirty, Private
2) Not Dirty, Not Private
3) Dirty, Not Private (wrong condition)

Did you get some more assert failed after this? If you umount UBIFS,
ubifs_put_super will check the budget info, and I think you should
hit some assertion there.

Do you have a simply way to reproduce this assert failed?


More information about the linux-mtd mailing list