ubifs_decompress: cannot decompress 2293 bytes, compressor lzo, error -22

Scott Zhang macromarship at gmail.com
Thu Apr 14 21:38:09 PDT 2022


Hi. Miquèl.
Yes. I tried nandbiterrs, the result is below. Looks ecc is not working .

[root at jgcx: ~]#./nandbiterrs /dev/mtd2 -i
incremental biterrors test
Successfully corrected 0 bit errors per subpage
Inserted biterror @ 0/5
Failed to recover 1 bitflips
Read error after 1 bit errors per page

By checking the nand driver whichi is nuc980_nand.c

https://github.com/OpenNuvoton/NUC980-linux-4.4.y/blob/master/drivers/mtd/nand/nuc980_nand.c


* Enable HW ECC : unused on most chips
*/
void nuc980_nand_enable_hwecc(struct mtd_info *mtd, int mode)
{
ENTER();
#ifdef NUC980_NAND_DEBUG
{
char * ptr=REG_SMRA0;
int i=0;
if( mode == NAND_ECC_READ )
printk("[R]=\n");
else
printk("[W]=\n");

for(i=0; i<mtd->oobsize; i++)
{
printk("%X ", *(ptr+i) );
if ( i % 32 == 31)
printk("\n");
}
printk("\n");
}
#endif
LEAVE();
}


I guess the nuc980 driver doesn't support ecc correction.



On Fri, Apr 15, 2022 at 1:24 AM Miquel Raynal <miquel.raynal at bootlin.com> wrote:
>
> Hi Scott,
>
> macromarship at gmail.com wrote on Fri, 15 Apr 2022 00:45:23 +0800:
>
> > Hello. Everyone.
> >      I encountered a strange problem about ubifs. My embed linux runs
> > well normally. But after about 3-4 days, developing php application,
> > copying files etc.. the /opt partition when read, the system become
> > very slow. After check dmesg
> > the output contains full of debug logs as below.
> >
> > [17588.040000] UBIFS error (ubi0:0 pid 15691): do_readpage: cannot
> > read page 15 of inode 396, error -22
> > [17590.080000] UBIFS error (ubi0:0 pid 15695): ubifs_decompress:
> > cannot decompress 2293 bytes, compressor lzo, error -22
> > [17590.090000] UBIFS error (ubi0:0 pid 15695): do_readpage: bad data
> > node (block 15, inode 396)
> > lots of hex dump, seems normal data
> >
> > Based on my understanding of ubi and ubi fs. The bottomest nand driver
> > has the ecc correction, then ubi has crc32 to verify data write and
> > read. Then when data come to ubifs, the data should be always correct.
> > Anything wrong will be reported firstly by ubi below or mtd nand
> > driver below.
> > So the msg shows above confuse me. Why did decompress fail for passed
> > crc32 data?
> > Is there anyway to simple drop the block 15, inode 396 so no warning
> > anymore. Even so many logs dumped ,the system continues runs , but
> > ramdomly hangs. Maybe no hang, the linux run led continues blink,
> > network led blink, the ping ip is not react.
> > Because I port the nand driver myself, and port everything to make
> > nand working. So Is there a possibility I make ecc checksum wrong,
> > then get this wierd problem?
> >
> > I googled first, and only see related discuss on 2011 but can't see it help.
> > https://linux-mtd.infradead.narkive.com/c65SedYp/ubifs-decompress-cannot-decompress
>
> Hello Scott, if you are unsure about your NAND implementation you can
> run all the nand/ubi tests available in the mtd-utils test suite (also
> available as a Buildroot package):
> https://git.infradead.org/mtd-utils.git
>
> Thanks,
> Miquèl



More information about the linux-mtd mailing list