tree: 0648ec1204dc31c4e21f24e6324d118e2dab58d1 [path history] [tgz]
  1. blk1g.bin.gz
  2. README.md
test_files/README.md

f2fs test file

Decompress gzip files.

$ gunzip third_party/f2fs/test_files/*.gz $ ls third_party/f2fs/test_files/ README.md blk1g.bin

blk1g.bin

  • It has three files with different sizes to test direct data blocks and indirect data blocks.
  • Properties: ‘4 KiB’ Block size, active_logs=6, no support for INLINE_DENTRY
  • Directory Tree . .. 100mb.bin 10mb.bin 1m.bin

File contents in blk1g.bin

Each file is filled with the same pattern of blocks and the beginning of each block has special header (40B) as below.

++++++++++++++++++++++++++++++++++ |Header (40B) for the 1st block | |0xf2f5 patterns | |... | ++++++++++++++++++++++++++++++++++ |Header (40B) for the 2nd block | |0xf2f5 patterns | |... |

The header (40B) consists of magic number(16B), offset (8B) and CRC, and the remaining is filled with the ‘0xf2f5’ pattern.

| offset | content | 0000000: caac 0100 0010 0000 0000 0000 0000 0000 ................ 0000010: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0000020: 0100 0000 5e61 4f8e f2f5 f2f5 f2f5 f2f5 ....^aO......... 0000030: f2f5 f2f5 f2f5 f2f5 f2f5 f2f5 f2f5 f2f5 ................ ... 0001000: caac 0100 0010 0000 0000 0000 0000 0000 ................ 0001010: 0010 0000 0000 0000 0000 0000 19c6 0100 ................ 0001020: 0100 0100 5d95 70b5 f2f5 f2f5 f2f5 f2f5 ....].p......... 0001030: f2f5 f2f5 f2f5 f2f5 f2f5 f2f5 f2f5 f2f5 ................ 0001040: f2f5 f2f5 f2f5 f2f5 f2f5 f2f5 f2f5 f2f5 ................

fs-test

  • Step #1: set up the build configuration with f2fs $ fx set core.x64 --with-base //bundles:tools --with-base //bundles:tests --with-base third_party/f2fs

  • Step #2: fx test basic-tests

Compatibility test with Linux v3.8

  • Step #1: set up a build configuration for f2fs $ fx set core.x64 --with-base //bundles:tools --with-base //bundles:tests --with-base third_party/f2fs

  • Step #2: run ‘fx emu’ $ fx emu -N --headless -hda third_party/f2fs/test_files/blk1g.bin

  • Step #3: copy a file in Fuchsia $ mkdir tmp/mnt $ mount /dev/class/block/000 /tmp/mnt $ cd /tmp/mnt $ cp 10mb.bin 10mb_dst.bin $ umount /tmp/mnt $ dm shutdown

  • Step #4: verify the copied file in Linux $ mkdir ~/mnt $ mount third_party/f2fs/test_files/blk1g.bin ~/mnt $ diff ~/mnt/10mb.bin ~/mnt/10mb_dst.bin

Caution

The curent Fuchsia F2FS does not support INLINE_DENTRY, and it is not fully compatible with Linux F2fs supporting INLINE_DENTRY.