1. 10 4月, 2019 5 次提交
    • B
      Fix ext4 block group descriptor sizing · febbc583
      Benjamin Lim 提交于
      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: NBenjamin Lim <jarsp.ctf@gmail.com>
      febbc583
    • G
      fs: ext4: Problem with ext4load and sparse files · 1c48fda3
      Gero Schumacher 提交于
      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
    • J
      fs: ext4: Add support for the creation of symbolic links · 5efc0686
      Jean-Jacques Hiblot 提交于
      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: NJean-Jacques Hiblot <jjhiblot@ti.com>
      Reviewed-by: NTom Rini <trini@konsulko.com>
      [trini: Fix ext4 env code]
      Signed-off-by: NTom Rini <trini@konsulko.com>
      5efc0686
    • J
      fs: ext4: constify the buffer passed to write functions · b000180b
      Jean-Jacques Hiblot 提交于
      There is no need to modify the buffer passed to ext4fs_write_file().
      The memset() call is not required here and was likely copied from the
      equivalent part of the ext4fs_read_file() function where we do need it.
      Signed-off-by: NJean-Jacques Hiblot <jjhiblot@ti.com>
      Reviewed-by: NTom Rini <trini@konsulko.com>
      b000180b
    • S
      fs: ext4: cache extent data · d5aee659
      Stephen Warren 提交于
      When a file contains extents, U-Boot currently reads extent-related data
      for each block in the file, even if that data is located in the same
      block each time. This significantly slows down loading of files that use
      extents. Implement a very dumb cache to prevent repeatedly reading the
      same block. Files with extents now load as fast as files without.
      
      Note: There are many cases where read_allocated_block() is called. This
      patch only addresses one of those places; all others still read redundant
      data in any case they did before. This is a minimal patch to fix the
      load command; other cases aren't fixed.
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      d5aee659
  2. 11 9月, 2018 1 次提交
  3. 07 5月, 2018 1 次提交
    • T
      SPDX: Convert all of our single license tags to Linux Kernel style · 83d290c5
      Tom Rini 提交于
      When U-Boot started using SPDX tags we were among the early adopters and
      there weren't a lot of other examples to borrow from.  So we picked the
      area of the file that usually had a full license text and replaced it
      with an appropriate SPDX-License-Identifier: entry.  Since then, the
      Linux Kernel has adopted SPDX tags and they place it as the very first
      line in a file (except where shebangs are used, then it's second line)
      and with slightly different comment styles than us.
      
      In part due to community overlap, in part due to better tag visibility
      and in part for other minor reasons, switch over to that style.
      
      This commit changes all instances where we have a single declared
      license in the tag as both the before and after are identical in tag
      contents.  There's also a few places where I found we did not have a tag
      and have introduced one.
      Signed-off-by: NTom Rini <trini@konsulko.com>
      83d290c5
  4. 10 3月, 2018 1 次提交
  5. 20 11月, 2017 1 次提交
  6. 06 10月, 2017 1 次提交
    • T
      fs/ext4: Fix group descriptor checksum calculation · 385b7318
      Tuomas Tynkkynen 提交于
      The current code doesn't compute the group descriptor checksum correctly
      for the filesystems that e2fsprogs 1.43.4 creates (they have
      'Group descriptor size: 64' as reported by tune2fs). Extend the checksum
      calculation to be done as ext4_group_desc_csum() does in Linux.
      
      This fixes these errors in dmesg from running fs-test.sh and makes it
      succeed again:
      
      [1671902.620699] EXT4-fs (loop1): ext4_check_descriptors: Checksum for group 0 failed (35782!=10965)
      [1671902.620706] EXT4-fs (loop1): group descriptors corrupted!
      Signed-off-by: NTuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
      385b7318
  7. 28 12月, 2016 1 次提交
  8. 22 11月, 2016 1 次提交
  9. 24 10月, 2016 3 次提交
  10. 23 9月, 2016 19 次提交
  11. 05 8月, 2016 1 次提交
    • T
      ext4: Refuse to mount filesystems with 64bit feature set · 6f94ab66
      Tom Rini 提交于
      With e2fsprogs after 1.43 the 64bit and metadata_csum features are
      enabled by default.  The metadata_csum feature changes how
      ext4_group_desc->bg_checksum is calculated, which would break write
      support.  The 64bit feature however introduces changes such that it
      cannot be read by implementations that do not support it.  Since we do
      not support this, we must not mount it.
      
      Cc: Stephen Warren <swarren@nvidia.com>
      Cc: Simon Glass <sjg@chromium.org>
      Cc: Lukasz Majewski <l.majewski@samsung.com>
      Cc: Stefan Roese <sr@denx.de>
      Reported-by: NAndrew Bradford <andrew.bradford@kodakalaris.com>
      Signed-off-by: NTom Rini <trini@konsulko.com>
      6f94ab66
  12. 03 5月, 2016 1 次提交
  13. 15 3月, 2016 1 次提交
  14. 14 1月, 2016 2 次提交
  15. 24 11月, 2015 1 次提交
    • T
      fs: ext4: Prevent infinite loop in ext4fs_iterate_dir · 54d68e93
      Thomas Fitzsimmons 提交于
      If the ext3 journal gets out of sync with what is written on disk, for
      example because of an unexpected power cut, ext4fs_read_file can
      return an all-zero directory entry.  In that case, ext4fs_iterate_dir
      would infinite loop.
      
      This patch detects when a directory entry's direntlen member is 0 and
      returns a failure status, which breaks out of the infinite loop.  As a
      result, U-Boot will not find files that may subsequently be recovered
      when the journal is replayed.
      
      This is better behaviour than hanging in an infinite loop, but as a
      further improvement maybe U-Boot could interpret the ext3 journal and
      actually find the unsynced entries.
      Signed-off-by: NThomas Fitzsimmons <fitzsim@cisco.com>
      Reviewed-by: NStefan Roese <sr@denx.de>
      54d68e93