1. 21 Jun, 2019 1 commit
  2. 29 May, 2019 3 commits
  3. 28 May, 2019 2 commits
  4. 05 May, 2019 1 commit
  5. 03 May, 2019 2 commits
  6. 27 Apr, 2019 1 commit
  7. 26 Apr, 2019 3 commits
    • Pierre Bourdon's avatar
      fs: btrfs: fix btrfs_search_tree invalid results · 1627e5e5
      Pierre Bourdon authored
      btrfs_search_tree should return the first item in the tree that is
      greater or equal to the searched item.
      
      The search algorithm did not properly handle the edge case where the
      searched item is higher than the last item of the node but lower than
      the first item of the next node. Instead of properly returning the first
      item of the next node, it was returning an invalid path pointer
      (pointing to a non-existent item after the last item of the node + 1).
      
      This fixes two issues in the btrfs driver:
        - Looking for a ROOT_ITEM could fail if it was the first item of its
          leaf node.
        - Iterating through DIR_INDEX entries (for readdir) could fail if the
          first DIR_INDEX entry was the first item of a leaf node.
      Signed-off-by: Pierre Bourdon's avatarPierre Bourdon <delroth@gmail.com>
      Cc: Marek Behun <marek.behun@nic.cz>
      1627e5e5
    • Ismael Luceno Cortes's avatar
    • Pierre Bourdon's avatar
      fs: btrfs: fix false negatives in ROOT_ITEM search · 633967f9
      Pierre Bourdon authored
      ROOT_ITEMs in btrfs are referenced without knowing their actual "offset"
      value. To perform these searches using only two items from the key, the
      btrfs driver uses a special "btrfs_search_tree_key_type" function.
      
      The algorithm used by that function to transform a 3-tuple search into a
      2-tuple search was subtly broken, leading to items not being found if
      they were the first in their tree node.
      
      This commit fixes btrfs_search_tree_key_type to properly behave in these
      situations.
      Signed-off-by: Pierre Bourdon's avatarPierre Bourdon <delroth@gmail.com>
      Cc: Marek Behun <marek.behun@nic.cz>
      633967f9
  8. 10 Apr, 2019 5 commits
    • Benjamin Lim's avatar
      Fix ext4 block group descriptor sizing · febbc583
      Benjamin Lim authored
      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
    • Anssi Hannula's avatar
      fs: fat: fix reading non-cluster-aligned root directory · 9b18358d
      Anssi Hannula authored
      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
      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
      fs: Add a new command to create symbolic links · aaa12157
      Jean-Jacques Hiblot authored
      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
      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
  9. 09 Apr, 2019 3 commits
  10. 22 Mar, 2019 1 commit
    • Sébastien Szymanski's avatar
      fs: ext4: do not write on filesystem with metadata_csum feature · 2e736551
      Sébastien Szymanski authored
      U-Boot doesn't support metadata_csum feature. Writing to filesystem with
      metadata_csum feature makes the filesystem corrupted and unbootable by
      Linux:
      
      [    2.527495] EXT4-fs (mmcblk0p2): ext4_check_descriptors: Checksum for group 0 failed (52188!=0)
      [    2.537421] EXT4-fs (mmcblk0p2): ext4_check_descriptors: Checksum for group 1 failed (5262!=0)
      ...
      [    2.653308] EXT4-fs (mmcblk0p2): ext4_check_descriptors: Checksum for group 14 failed (42611!=0)
      [    2.662179] EXT4-fs (mmcblk0p2): ext4_check_descriptors: Checksum for group 15 failed (21527!=0)
      [    2.687920] JBD2: journal checksum error
      [    2.691982] EXT4-fs (mmcblk0p2): error loading journal
      [    2.698292] VFS: Cannot open root device "mmcblk0p2" or unknown-block(179,2): error -74
      
      Don't write to filesystem with meatadata_csum feature to not corrupt the
      filesystem.
      Signed-off-by: default avatarSébastien Szymanski <sebastien.szymanski@armadeus.com>
      2e736551
  11. 28 Feb, 2019 1 commit
  12. 19 Feb, 2019 2 commits
  13. 09 Feb, 2019 1 commit
    • Marek Vasut's avatar
      fs: ext4: Unmount FS in do_fs_type() · e531c673
      Marek Vasut authored
      Unlike other generic FS accessors, fs_get_info() does not call fs_close()
      at the end of it's operation. Thus, using fs_get_info() in do_fs_type()
      without calling fs_close() causes potential memory leak by creating new
      filesystem structures on each call of do_fs_type().
      
      The test case to trigger this problem is as follows. It is required to
      have ext4 filesystem on the first partition of the SDMMC device, since
      ext4 requires stateful mount and causes memory allocation.
      => while true ; do mmc rescan ; fstype mmc 1 ; done
      Eventually, the mounting of ext4 will fail due to malloc failures
      and the filesystem will not be correctly detected.
      
      This patch fixes the problem by adding the missing fs_close().
      Signed-off-by: default avatarMarek Vasut <marek.vasut+renesas@gmail.com>
      Cc: Simon Glass <sjg@chromium.org>
      Cc: Tom Rini <trini@konsulko.com>
      e531c673
  14. 02 Feb, 2019 1 commit
  15. 01 Feb, 2019 4 commits
  16. 16 Jan, 2019 1 commit
  17. 11 Jan, 2019 1 commit
  18. 31 Dec, 2018 2 commits
  19. 07 Dec, 2018 2 commits
    • Patrick Wildt's avatar
      fs: fix FAT name extraction · 8b021bb9
      Patrick Wildt authored
      The long name apparently can be accumulated using multiple
      13-byte slots.  Unfortunately we never checked how many we
      can actually fit in the buffer we are reading to.
      Signed-off-by: default avatarPatrick Wildt <patrick@blueri.se>
      8b021bb9
    • Patrick Wildt's avatar
      fs: check FAT cluster size · cd80a4fe
      Patrick Wildt authored
      The cluster size specifies how many sectors make up a cluster.  A
      cluster size of zero makes no sense, as it would mean that the
      cluster is made up of no sectors.  This will later lead into a
      division by zero in sect_to_clust(), so better take care of that
      early.
      
      The MAX_CLUSTSIZE define can reduced using a define to make some
      room in low-memory system.  Unfortunately if the code reads a
      filesystem with a bigger cluster size it will overflow the buffer.
      Signed-off-by: default avatarPatrick Wildt <patrick@blueri.se>
      cd80a4fe
  20. 02 Dec, 2018 1 commit
  21. 20 Nov, 2018 1 commit
  22. 16 Nov, 2018 1 commit