tree: 50a052c5ef4e554f922ffef1b038c80a994a1a74 [path history] [tgz]
  1. blk500m.bin.gz
  2. README.md
test_files/README.md

f2fs test file

Decompress gzip files to get the f2fs test images.

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

Use blk500m.bin to run fs-bench. Use blk1g.bin to test write and verify.

blk500m.bin

  • It has no file in the root directory
  • Properties: ‘4 KiB’ Block size, active_logs=6, no support for INLINE_DENTRY
  • Directory Tree . ..

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 ................

Directory and File Test with fs-bench

(fuchsia base code: 76a08ad1474 [speak] Migrate to new component template)

  • Step #1: configure the bringup.x64 product with base packages and f2fs library $ fx set bringup.x64 --with //bundles:tools --with-base //bundles/buildbot:bringup --with-base third_party/f2fs --with-base third_party/f2fs/tools:f2fs-tools

  • Step #2: run qemu with an option ‘-hda third_party/f2fs/test_files/blk500m.bin’ $ fx emu -N --headless -hda third_party/f2fs/test_files/blk500m.bin

  • Step #3: run fs-bench in fuchsia $ /boot/test/fs-bench --block_device /dev/class/block/000 --fs f2fs

  • Output [----------] 2 tests from f2fs/Bigfile/16Kbytes/1024-Ops [../../zircon/system/ulib/fs-test-utils/fixture.cc:328] Info: Using random seed: 3049177432 ....

[==========] 19 tests from 8 test cases ran. (4339 ms total) [ PASSED ] 19 tests. [ FAILED ] 0 tests. [ SKIPPED ] 0 tests.

Compatibility test with Linux v3.8

(fuchsia base code: 76a08ad1474 [speak] Migrate to new component template)

  • Step #1: configure the bringup.x64 product with base packages and f2fs library $ fx set bringup.x64 --with //bundles:tools --with-base //bundles/buildbot:bringup --with-base third_party/f2fs --with-base third_party/f2fs/tools:f2fs-tools

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

  • Step #3: run cp in the f2fs root directory $ 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.