mounting ubifs read-only, is it really readonly, not any wirte/erase?

Caizhiyong caizhiyong at huawei.com
Thu May 16 09:36:40 EDT 2013


    I'm using ubifs as root filesystem, and mounted readonly.

    bootargs are:
        console=ttyAMA0,115200 ubi.mtd=3 root=ubi0:ubifs ro rootfstype=ubifsmtdparts=hi_sfc:-(spi);hinand:10M(10M),50M(50M),50M(50M),-(data)
    
    I'm update ubi.img in uboot used command "nand write xxxx", but when kernel (linux 3.4) startup, there are some write/erase operation.

    I'm add prints to the following functions:

        * %-EIO is returned, the physical eraseblock most probably went bad.
        */
        static int do_sync_erase(struct ubi_device *ubi, int pnum)
        {
            int err, retries = 0;
            struct erase_info ei;
            wait_queue_head_t wq;

            dump_stack();
            printk("\n\n\n");
            return 0;

    The stack dump prints as follow:

        [<c0014c64>] (unwind_backtrace+0x0/0xfc) from [<c02a2a2c>] (do_sync_erase+0x8/0x1c)
        [<c02a2a2c>] (do_sync_erase+0x8/0x1c) from [<c02a3818>] (ubi_io_sync_erase+0x304/0x424)
        [<c02a3818>] (ubi_io_sync_erase+0x304/0x424) from [<c02a41e8>] (erase_worker+0x50/0x510)
        [<c02a41e8>] (erase_worker+0x50/0x510) from [<c02a4f80>] (do_work+0x84/0xd4)
        [<c02a4f80>] (do_work+0x84/0xd4) from [<c02a50ac>] (ubi_thread+0xdc/0x188)
        [<c02a50ac>] (ubi_thread+0xdc/0x188) from [<c0039468>] (kthread+0x94/0x98)
        [<c0039468>] (kthread+0x94/0x98) from [<c000f92c>] (kernel_thread_exit+0x0/0x8)

    mtdinfo -a

        mtd2
        Name:                           50M
        Type:                           nand
        Eraseblock size:                131072 bytes, 128.0 KiB
        Amount of eraseblocks:          400 (52428800 bytes, 50.0 MiB)
        Minimum input/output unit size: 2048 bytes
        Sub-page size:                  2048 bytes
        OOB size:                       64 bytes
        Character device major/minor:   90:4
        Bad blocks are allowed:         true
        Device is writable:             true

    
    I'm directly retrun 0 in the function do_sync_erase, is there any problems ?
 
Looking forward to your feedback.
Best regards,
Cai Zhiyong.

http://www.huawei.com
--------------------------------------------------------------------
本邮件及其附件含有华为公司的保密信息,仅限于发送给上面地址中列出的个人或群组。禁
止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制、或散发)本邮件中
的信息。如果您错收了本邮件,请您立即电话或邮件通知发件人并删除本邮件!
This e-mail and its attachments contain confidential information from HUAWEI, which
is intended only for the person or entity whose address is listed above. Any use of the
information contained herein in any way (including, but not limited to, total or partial
disclosure, reproduction, or dissemination) by persons other than the intended
recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender by
phone or email immediately and delete it!



More information about the linux-mtd mailing list