UBI scrubbing behavior when readonly

Chuck Meade chuckmeade at gmail.com
Fri Dec 8 13:33:59 PST 2023


On 12/7/23 21:00, Zhihao Cheng wrote:
> 在 2023/12/8 1:56, Chuck Meade 写道:
>> Hello,
>>
>> Does UBI scrubbing (moving data to new PEB when read operations report ECC
>> bitflips) still occur when a UBIFS mounted on the UBI volume is readonly, in
>> terms of Linux filesystem permissions?
>>
>> I have looked at the UBI source for scrubbing, and it appears that it will not
>> occur when the UBI device (or MTD partition to which the device is attached)
>> is in readonly mode. But what if the UBI device is in read/write mode, but the
>> UBIFS mounted on the device is in readonly mode?
>>
> Does 'UBI scrubbing' mean the wear_leveling_worker(e1 comes from ubi->scrub)? If so, I think it still work when UBI is rw mode and ubifs is readonly. For example: ubifs_leb_read -> ubi_leb_read -> 
> ubi_eba_read_leb -> ubi_wl_scrub_peb: wl_tree_add(e, &ubi->scrub)  && ensure_wear_leveling

UBI scrubbing is performed when a read operation reports ECC bitflips.  UBI moves
data to a new PEB and erases the old PEB that had too many ECC bitflips.  I'm
just trying to determine if it can work under a readonly UBIFS if the UBI device/
volume is read/write.

Thanks for your reply.  It sounds like you think this will work as desired.

>> I am trying to create a configuration where the UBIFS is readonly at the Linux
>> filesystem permissions level, but UBI scrubbing still occurs when read
>> operations report enough ECC bitflips.  So no Linux userspace programs may
>> modify the filesystem due to permissions, but UBI scrubbing still would occur.
>>
>> Is this possible, or am I missing something in the UBI source code?
>>
>> Thanks,
>> Chuck
>>
>>
>> ______________________________________________________
>> Linux MTD discussion mailing list
>> http://lists.infradead.org/mailman/listinfo/linux-mtd/
> 
> 




More information about the linux-mtd mailing list