UBIFS assert failed: !list_empty(&sleb->nodes), in fs/ubifs/gc.c:516 or UBIFS assert failed: dirty == LPROPS_NC || dirty >= 0, in fs/ubifs/lprops.c:557

Alexandra Lu (Nokia) alexandra.lu at nokia.com
Sat Jun 17 07:45:41 PDT 2023


Hi,

I'm having an issue with ubifs LEB property corruption, which causes 2 different flavors of ubi exceptions:

1) This happens when trying to copy a very large file to the file system, copying small file still works:
root at sar:~# dmesg 
[ 4590.237822] UBIFS error (ubi1:0 pid 2011): ubifs_assert_failed: UBIFS assert failed: !list_empty(&sleb->nodes), in fs/ubifs/gc.c:516
[ 4590.237850] UBIFS warning (ubi1:0 pid 2011): ubifs_ro_mode.part.0: switched to read-only mode, error -22
[ 4590.237865] CPU: 0 PID: 2011 Comm: loop0 Tainted: G           O      4.19.26 #1


2) This happens when mounting the file system after a graceful power cycle reboot (not power cut in the middle of user space file operation):
|gash: 06/16/23 09:10:07.681| UBI device number 1, total 3068 LEBs (389562368 bytes, 371.5 MiB), available 0 LEBs (0 bytes), LEB size 126976 bytes (124.0 KiB)
|gash: 06/16/23 09:10:07.816| [   47.974899] UBIFS (ubi1:0): background thread "ubifs_bgt1_0" started, PID 1905
|gash: 06/16/23 09:10:07.917| [   48.005772] UBIFS (ubi1:0): recovery needed
|gash: 06/16/23 09:10:09.229| [   49.409644] UBIFS error (ubi1:0 pid 1904): ubifs_assert_failed: UBIFS assert failed: dirty == LPROPS_NC || dirty >= 0, in fs/ubifs/lprops.c:557
|gash: 06/16/23 09:10:09.240| [   49.422534] UBIFS warning (ubi1:0 pid 1904): ubifs_ro_mode.part.0: switched to read-only mode, error -22

|gash: 06/16/23 09:10:14.541| [   54.721605] LEB 362     free 0        dirty 44096    used 82880    free + dirty 44096    dark 6144 dead 0    nodes fit 10  flags 0x1  (dirty)
|gash: 06/16/23 09:10:14.556| [   54.734285] LEB 363     free 2048     dirty -248     used 125176   free + dirty 1800     dark 0    dead 1800 nodes fit 0   flags 0x10 (taken, bud of jhead 0 (GC))
|gash: 06/16/23 09:10:14.571| [   54.748783] LEB 364     free 0        dirty 44096    used 82880    free + dirty 44096    dark 6144 dead 0    nodes fit 10  flags 0x1  (dirty)


In the 2nd case, I could see what the corruption is, but how it got into that state is a mystery. We suspect the issue might be related to switching back and forth the same file system between a native ubifs mount and a coipfs+xattr mount, but it is very hard to reproduce in order to isolate xattr as the cause. I came across the following email thread online which is of interest, and am reaching out to this mailing list to see if I could get some pointers with the trouble shooting. For example, under what circumstances could the dirty bit turn negative?

https://linux-mtd.infradead.narkive.com/sYWUjXnZ/ubifs-question-power-cuts-after-ubifs-leb-unmap

Thanks,

Alexandra




More information about the linux-mtd mailing list