Hello Experts,

We are seeing fragmentation and resultant eMMC partition corruption when 
extracting tar file with 81000 files of 4k size.

Detailed steps are listed in Test_steps.txt file and other attached tars 
contain required scripts to big tar file and other test scripts.

In test is very simple, 
1. we have tar with 81000 number of 4k size file
2. we ran latest debian from Beagleboard.org from Micro SD Card
3. Partitioned eMMC in two partitions
4. Then mounted one of the partition and started extracting big tar file on 
that partition.

This results in below Error.
EXT4-fs error (device mmcblk1p2) in ext4_do_update_inode:4665: Journal has 
aborted
[12064.194479] EXT4-fs error (device mmcblk1p2) in add_dirent_to_buf:1921: 
Journal has aborted
[12064.209980] EXT4-fs error (device mmcblk1p2) in 
ext4_do_update_inode:4665: Journal has aborted
[12064.223765] EXT4-fs error (device mmcblk1p2) in ext4_create:2455: IO 
failure
[12064.238221] EXT4-fs error (device mmcblk1p2): 
ext4_journal_check_start:56: Detected aborted journal
[12064.247591] EXT4-fs (mmcblk1p2): Remounting filesystem read-only


Strange enough this test works fine on Angstrom OS 
image 
https://s3.amazonaws.com/angstrom/demo/beaglebone/Angstrom-Cloud9-IDE-GNOME-eglibc-ipk-v2012.12-beaglebone-2013.06.20.img.xz
That image has kernel 3.8, while latest debian has kernel 4.4.

I suspect some memory leak in the driver(edma.c).

We see this issue sporadically in field devices so this is not unrealistic 
error.
We got this use case to reproduce this issue.

Any suggestion, patch to solve this issue ?

Thank you,

Regards,
Ankur

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/6f6d186e-b9a4-4e49-8955-5624ac3d26e5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Attachment: run_on_bbb.tar.gz
Description: Binary data

Attachment: run_on_linux_pc.tar.gz
Description: Binary data

Warnning!! These test steps are kind of descructive, you will loose content in 
your eMMC, so be sure to take backup, if need be.

Preparing BBB for test.
------------------------

If  you already have debian running on "MICRO SD CARD"[Test requires debian on 
micro SD] skip steps 1 & 2
1. Download debian from below location
        
https://debian.beagleboard.org/images/bone-debian-8.7-lxqt-4gb-armhf-2017-03-19-4gb.img.xz
2. Flash it on microsd card using instruction avilable in below link under 
title "Creating an SD Card Image"
        http://derekmolloy.ie/write-a-new-image-to-the-beaglebone-black/
        [I did it on win32 Disk Imagager, however it can be done on linux as 
well]
3. Now insert micro SD card in BBB and power it up with S2 Key pressed to boot 
from micro SD card.
4. After booting, delete following directories to make enough room for storing 
big tar file
   rm -rf /usr/share/doc

Test setup to be done on linux pc.
----------------------------------
1. Extract run_on_linux_pc.tar.gz attached here.
2. cd run_on_linux_pc
3. run generate_files.sh with arguments 4k and 81000 as follows
   ./generate_files.sh 4k 81000
   this will take a while, wait until it completes
   [Basically it creates 81000 number of 4k size files, and tars them and 
creates rootfs.tar.gz]
4. transfer rootfs.tar.gz created in above step to BBB's /home/debian/ 
directory.
5. Now extract run_on_bbb.tar.gz and 
6. Now transfer run_on_bbb and rootfs.tar.gz to BBB's /home/debian/ directory.


Now Test steps on BBB
----------------------------------

1. on BBB change directory to run_on_bbb directory 
   i.e. cd run_on_bbb
1. make sure you have following files/directory in your /home/debian/ 
directories.
   a. rootfs.tar.gz
   b. run_on_bbb
      ├── partition_emmc.sh
      ├── recover_partitions.sh
      └── script_to_removefiles_and_extracttar.sh
2. change user to root using below command
   sudo su
3. run partition_emmc.sh script, which will partition eMMC and formats it into 
two partitions.
4. Once that is done, run script_to_removefiles_and_extracttar.sh
5. After a while you will see error in your ssh or serial console.
6. After tar exits script will exit with an error.
7. to recover run recover_partitions.sh script, which runs fsck on the 
partitions to correct filesystem error.

FYI: Tar doesn't exit if it is not able to write a file on the partition, it 
continues, However test will exit once tar is done extracting files.







Reply via email to