Skip to content
Snippets Groups Projects
  1. Apr 12, 2019
  2. Apr 11, 2019
  3. Apr 10, 2019
    • Tom Rini's avatar
      Merge branch '2019-04-09-master-imports-fs' · 48ff1bc4
      Tom Rini authored
      - test.py tests for mmc
      - ext4 symlink support and other fixes
      - ext4 block group descriptor sizing
      48ff1bc4
    • Tom Rini's avatar
      test.py: Disable fsck for FAT tests for now · 0a840660
      Tom Rini authored
      
      Currently enabling fsck on FAT16/FAT32 exposes that we have problems
      with:
      TestFsBasic.test_fs13[fat16]
      TestFsBasic.test_fs11[fat32]
      TestFsBasic.test_fs12[fat32]
      TestFsBasic.test_fs13[fat32]
      TestFsExt.test_fs_ext1[fat32]
      TestFsExt.test_fs_ext2[fat32]
      TestFsExt.test_fs_ext3[fat32]
      TestFsExt.test_fs_ext4[fat32]
      TestFsExt.test_fs_ext5[fat32]
      TestFsExt.test_fs_ext6[fat32]
      TestFsExt.test_fs_ext7[fat32]
      TestFsExt.test_fs_ext8[fat32]
      TestFsExt.test_fs_ext9[fat32]
      TestMkdir.test_mkdir6[fat16]
      TestMkdir.test_mkdir1[fat32]
      TestMkdir.test_mkdir2[fat32]
      TestMkdir.test_mkdir3[fat32]
      TestMkdir.test_mkdir4[fat32]
      TestMkdir.test_mkdir5[fat32]
      TestMkdir.test_mkdir6[fat32]
      TestUnlink.test_unlink1[fat16]
      TestUnlink.test_unlink2[fat16]
      TestUnlink.test_unlink3[fat16]
      TestUnlink.test_unlink4[fat16]
      TestUnlink.test_unlink5[fat16]
      TestUnlink.test_unlink6[fat16]
      TestUnlink.test_unlink7[fat16]
      TestUnlink.test_unlink1[fat32]
      TestUnlink.test_unlink2[fat32]
      TestUnlink.test_unlink3[fat32]
      TestUnlink.test_unlink4[fat32]
      TestUnlink.test_unlink5[fat32]
      TestUnlink.test_unlink6[fat32]
      TestUnlink.test_unlink7[fat32]
      
      This is because we don't update the "information sector" on FAT32.
      While in the future we should resolve this problem and include that
      feature, we should enable fsck for ext4 to ensure that things remain in
      good shape there.
      
      Signed-off-by: default avatarTom Rini <trini@konsulko.com>
      0a840660
    • Benjamin Lim's avatar
      Fix ext4 block group descriptor sizing · febbc583
      Benjamin Lim authored and Tom Rini's avatar Tom Rini committed
      
      Ext4 allows for arbitrarily sized block group descriptors when 64-bit
      addressing is enabled, which was previously not properly supported. This
      patch dynamically allocates a chunk of memory of the correct size.
      
      Signed-off-by: default avatarBenjamin Lim <jarsp.ctf@gmail.com>
      febbc583
    • Marek Vasut's avatar
      test/py: mmc: Add 'mmc read' performance check · e5519797
      Marek Vasut authored and Tom Rini's avatar Tom Rini committed
      
      Add option to the mmc rd test to check the duration of the
      execution of the mmc read command. This allows intercepting
      read performance regressions.
      
      Signed-off-by: default avatarMarek Vasut <marek.vasut+renesas@gmail.com>
      Cc: Tom Rini <trini@konsulko.com>
      Cc: Simon Glass <sjg@chromium.org>
      Reviewed-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      e5519797
    • Marek Vasut's avatar
      test/py: mmc: Add 'mmc info' test · 4ffec8cd
      Marek Vasut authored and Tom Rini's avatar Tom Rini committed
      
      Add test for 'mmc info' subcommand. This tests whether the card
      information is obtained correctly and verifies the device, bus
      speed, bus mode and bus width.
      
      Signed-off-by: default avatarMarek Vasut <marek.vasut+renesas@gmail.com>
      Cc: Tom Rini <trini@konsulko.com>
      Cc: Simon Glass <sjg@chromium.org>
      Reviewed-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      4ffec8cd
    • Marek Vasut's avatar
      test/py: mmc: Add 'mmc rescan' test · ce4b2caf
      Marek Vasut authored and Tom Rini's avatar Tom Rini committed
      
      Add test for 'mmc rescan' subcommand. This tests whether the
      system can switch to a specific card and then rescan the card.
      
      Signed-off-by: default avatarMarek Vasut <marek.vasut+renesas@gmail.com>
      Cc: Tom Rini <trini@konsulko.com>
      Cc: Simon Glass <sjg@chromium.org>
      Reviewed-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      ce4b2caf
    • Marek Vasut's avatar
      test/py: mmc: Add 'mmc dev' test · 86dfd152
      Marek Vasut authored and Tom Rini's avatar Tom Rini committed
      
      Add separate test for 'mmc dev' subcommand. This tests whether
      the system can switch to a specific card.
      
      Signed-off-by: default avatarMarek Vasut <marek.vasut+renesas@gmail.com>
      Cc: Tom Rini <trini@konsulko.com>
      Cc: Simon Glass <sjg@chromium.org>
      Reviewed-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      86dfd152
    • Marek Vasut's avatar
      test/py: mmc: Factor out device selection · d22f7ad8
      Marek Vasut authored and Tom Rini's avatar Tom Rini committed
      
      Factor out the 'mmc dev' call so it can be recycled by other tests.
      
      Signed-off-by: default avatarMarek Vasut <marek.vasut+renesas@gmail.com>
      Cc: Tom Rini <trini@konsulko.com>
      Cc: Simon Glass <sjg@chromium.org>
      Reviewed-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      d22f7ad8
    • Anssi Hannula's avatar
      fs: fat: fix reading non-cluster-aligned root directory · 9b18358d
      Anssi Hannula authored and Tom Rini's avatar Tom Rini committed
      
      A FAT12/FAT16 root directory location is specified by a sector offset and
      it might not start at a cluster boundary. It also resides before the
      data area (before cluster 2).
      
      However, the current code assumes that the root directory is located at
      a beginning of a cluster, causing no files to be found if that is not
      the case.
      
      Since the FAT12/FAT16 root directory is located before the data area
      and is not aligned to clusters, using unsigned cluster numbers to refer
      to the root directory does not work well (the "cluster number" may be
      negative, and even allowing it be signed would not make it properly
      aligned).
      
      Modify the code to not use the normal cluster numbering when referring to
      the root directory of FAT12/FAT16 and instead use a cluster-sized
      offsets counted from the root directory start sector.
      
      This is a relatively common case as at least the filesystem formatter on
      Win7 seems to create such filesystems by default on 2GB USB sticks when
      "FAT" is selected (cluster size 64 sectors, rootdir size 32 sectors,
      rootdir starts at half a cluster before cluster 2).
      
      dosfstools mkfs.vfat does not seem to create affected filesystems.
      
      Signed-off-by: default avatarAnssi Hannula <anssi.hannula@bitwise.fi>
      Reviewed-by: default avatarBernhard Messerklinger <bernhard.messerklinger@br-automation.com>
      Tested-by: default avatarBernhard Messerklinger <bernhard.messerklinger@br-automation.com>
      9b18358d
    • Gero Schumacher's avatar
      fs: ext4: Problem with ext4load and sparse files · 1c48fda3
      Gero Schumacher authored and Tom Rini's avatar Tom Rini committed
      Hi,
      
      when I try to load a sparse file via ext4load, I am getting the error message
      'invalid extent'
      
      After a deeper look in the code, it seems to be an issue in the function ext4fs_get_extent_block in fs/ext4/ext4_common.c:
      
      The file starts with 1k of zeros. The blocksize is 1024. So the first extend block contains the following information:
      
      eh_entries: 1
      eh_depth: 1
      ei_block 1
      
      When the upper layer (ext4fs_read_file) asks for fileblock 0, we are running in the 'invalid extent' error message.
      For me it seems, that the code is not prepared for handling a sparse block at the beginning of the file. The following change, solved my problem:
      
      I am really not an expert in ext4 filesystems. Can somebody please have a look at this issue and give me a feedback, if I am totally wrong or not?
      1c48fda3
    • Jean-Jacques Hiblot's avatar
      test: fs: Added tests for symlinks · ef79284e
      Jean-Jacques Hiblot authored and Tom Rini's avatar Tom Rini committed
      
      Test cases are:
      1) basic link creation, verify it can be followed
      2) chained links, verify it can be followed
      3) replace exiting file a with a link, and a link with a link. verify it
         can be followed
      4) create a broken link, verify it can't be followed
      
      Signed-off-by: default avatarJean-Jacques Hiblot <jjhiblot@ti.com>
      Reviewed-by: default avatarTom Rini <trini@konsulko.com>
      ef79284e
    • Jean-Jacques Hiblot's avatar
      fs: Add a new command to create symbolic links · aaa12157
      Jean-Jacques Hiblot authored and Tom Rini's avatar Tom Rini committed
      
      The command line is:
      ln <interface> <dev[:part]> target linkname
      
      Currently symbolic links are supported only in ext4 and only if the option
      CMD_EXT4_WRITE is enabled.
      
      Signed-off-by: default avatarJean-Jacques Hiblot <jjhiblot@ti.com>
      Reviewed-by: default avatarTom Rini <trini@konsulko.com>
      aaa12157
    • Jean-Jacques Hiblot's avatar
      fs: ext4: Add support for the creation of symbolic links · 5efc0686
      Jean-Jacques Hiblot authored and Tom Rini's avatar Tom Rini committed
      
      Re-use the functions used to write/create a file, to support creation of a
      symbolic link.
      The difference with a regular file are small:
      - The inode mode is flagged with S_IFLNK instead of S_IFREG
      - The ext2_dirent's filetype is FILETYPE_SYMLINK instead of FILETYPE_REG
      - Instead of storing the content of a file in allocated blocks, the path
      to the target is stored. And if the target's path is short enough, no block
      is allocated and the target's path is stored in ext2_inode.b.symlink
      
      As with regulars files, if a file/symlink with the same name exits, it is
      unlinked first and then re-created.
      
      Signed-off-by: default avatarJean-Jacques Hiblot <jjhiblot@ti.com>
      Reviewed-by: default avatarTom Rini <trini@konsulko.com>
      [trini: Fix ext4 env code]
      Signed-off-by: default avatarTom Rini <trini@konsulko.com>
      5efc0686
  4. Apr 09, 2019
Loading