1. 05 Aug, 2016 1 commit
    • Tom Rini's avatar
      ext4: Refuse to mount filesystems with 64bit feature set · 6f94ab66
      Tom Rini authored
      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: default avatarAndrew Bradford <andrew.bradford@kodakalaris.com>
      Signed-off-by: default avatarTom Rini <trini@konsulko.com>
      6f94ab66
  2. 02 May, 2016 1 commit
  3. 14 Mar, 2016 2 commits
  4. 14 Jan, 2016 2 commits
  5. 23 Nov, 2015 1 commit
    • Thomas Fitzsimmons's avatar
      fs: ext4: Prevent infinite loop in ext4fs_iterate_dir · 54d68e93
      Thomas Fitzsimmons authored
      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: default avatarThomas Fitzsimmons <fitzsim@cisco.com>
      Reviewed-by: default avatarStefan Roese <sr@denx.de>
      54d68e93
  6. 11 Sep, 2015 5 commits
  7. 06 Mar, 2015 1 commit
  8. 01 Dec, 2014 1 commit
  9. 23 Nov, 2014 4 commits
  10. 27 Oct, 2014 1 commit
  11. 24 Sep, 2014 1 commit
  12. 09 Aug, 2014 1 commit
    • Stephen Warren's avatar
      fs: implement size/fatsize/ext4size · cf659819
      Stephen Warren authored
      These commands may be used to determine the size of a file without
      actually reading the whole file content into memory. This may be used
      to determine if the file will fit into the memory buffer that will
      contain it. In particular, the DFU code will use it for this purpose
      in the next commit.
      Signed-off-by: default avatarStephen Warren <swarren@nvidia.com>
      cf659819
  13. 19 Jun, 2014 1 commit
    • Stephen Warren's avatar
      fs: ext4: fix writing zero-length files · d0180280
      Stephen Warren authored
      ext4fs_allocate_blocks() always allocates at least one block for a file.
      If the file size is zero, this causes total_remaining_blocks to
      underflow, which then causes an apparent hang while 2^32 blocks are
      allocated.
      
      To solve this, check that total_remaining_blocks is non-zero as part of
      the loop condition (i.e. before each loop) rather than at the end of
      the loop.
      Signed-off-by: default avatarStephen Warren <swarren@nvidia.com>
      d0180280
  14. 11 Jun, 2014 1 commit
  15. 12 May, 2014 2 commits
    • Łukasz Majewski's avatar
      fs:ext4:write:fix: Reinitialize global variables after updating a file · 8b454eee
      Łukasz Majewski authored
      This bug shows up when file stored on the ext4 file system is updated.
      
      The ext4fs_delete_file() is responsible for deleting file's (e.g. uImage)
      data.
      However some global data (especially ext4fs_indir2_block), which is used
      during file deletion are left unchanged.
      
      The ext4fs_indir2_block pointer stores reference to old ext4 double
      indirect allocated blocks. When it is unchanged, after file deletion,
      ext4fs_write_file() uses the same pointer (since it is already initialized
      - i.e. not NULL) to return number of blocks to write. This trunks larger
      file when previous one was smaller.
      
      Lets consider following scenario:
      
      1. Flash target with ext4 formatted boot.img (which has uImage [*] on itself)
      2. Developer wants to upload their custom uImage [**]
      	- When new uImage [**] is smaller than the [*] - everything works
      	correctly - we are able to store the whole smaller file with corrupted
      	ext4fs_indir2_block pointer
      	- When new uImage [**] is larger than the [*] - theCRC is corrupted,
      	since truncation on data stored at eMMC was done.
      3. When uImage CRC error appears, then reboot and LTHOR/DFU reflashing causes
      	proper setting of ext4fs_indir2_block() and after that uImage[**]
      	is successfully stored (correct uImage [*] metadata is stored at an
      	eMMC on the first flashing).
      
      Due to above the bug was very difficult to reproduce.
      This patch sets default values for all ext4fs_indir* pointers/variables.
      Signed-off-by: default avatarLukasz Majewski <l.majewski@samsung.com>
      8b454eee
    • Łukasz Majewski's avatar
      fs:ext4:cleanup: Remove superfluous code · 35dd055b
      Łukasz Majewski authored
      Code responsible for handling situation when ext4 has block size of 1024B
      can be ordered to take less space.
      
      This patch does that for ext4 common and write files.
      Signed-off-by: default avatarLukasz Majewski <l.majewski@samsung.com>
      35dd055b
  16. 26 Feb, 2014 1 commit
  17. 21 Feb, 2014 1 commit
    • Ionut Nicu's avatar
      ext4fs: Add ext4 extent cache for read operations · fc0fc50f
      Ionut Nicu authored
      In an ext4 filesystem, the inode corresponding to a file has a 60-byte
      area which contains an extent header structure and up to 4 extent
      structures (5 x 12 bytes).
      
      For files that need more than 4 extents to be represented (either files
      larger than 4 x 128MB = 512MB or smaller files but very fragmented),
      ext4 creates extent index structures. Each extent index points to a 4KB
      physical block where one extent header and additional 340 extents could
      be stored.
      
      The current u-boot ext4 code is very inefficient when it tries to load a
      file which has extent indexes. For each logical file block the code will
      read over and over again the same blocks of 4096 bytes from the disk.
      
      Since the extent tree in a file is always the same, we can cache the
      extent structures in memory before actually starting to read the file.
      
      This patch creates a simple linked list of structures holding information
      about all the extents used to represent a file. The list is sorted by
      the logical block number (ee_block) so that we can easily find the
      proper extent information for any file block.
      
      Without this patch, a 69MB file which had just one extent index pointing
      to a block with another 6 extents was read in approximately 3 minutes.
      With this patch applied the same file can be read in almost 20 seconds.
      Signed-off-by: default avatarIonut Nicu <ioan.nicu.ext@nsn.com>
      fc0fc50f
  18. 19 Feb, 2014 1 commit
  19. 20 Jan, 2014 4 commits
  20. 17 Nov, 2013 1 commit
  21. 31 Oct, 2013 1 commit
  22. 24 Jul, 2013 1 commit
  23. 22 Jul, 2013 1 commit
  24. 15 Jul, 2013 1 commit
    • Frederic Leroy's avatar
      Fix ext2/ext4 filesystem accesses beyond 2TiB · 04735e9c
      Frederic Leroy authored
      With CONFIG_SYS_64BIT_LBA, lbaint_t gets defined as a 64-bit type,
      which is required to represent block numbers for storage devices that
      exceed 2TiB (the block size usually is 512B), e.g. recent hard drives
      
      We now use lbaint_t for partition offset to reflect the lbaint_t change,
      and access partitions beyond or crossing the 2.1TiB limit.
      This required changes to signature of ext4fs_devread(), and type of all
      variables relatives to block sector.
      
      ext2/ext4 fs uses logical block represented by a 32 bit value. Logical
      block is a multiple of device block sector. To avoid overflow problem
      when calling ext4fs_devread(), we need to cast the sector parameter.
      Signed-off-by: default avatarFrédéric Leroy <fredo@starox.org>
      04735e9c
  25. 24 May, 2013 1 commit
  26. 10 May, 2013 1 commit
  27. 01 Apr, 2013 1 commit
    • York Sun's avatar
      Consolidate bool type · 472d5460
      York Sun authored
      'bool' is defined in random places. This patch consolidates them into a
      single header file include/linux/types.h, using stdbool.h introduced in C99.
      
      All other #define, typedef and enum are removed. They are all consistent with
      true = 1, false = 0.
      
      Replace FALSE, False with false. Replace TRUE, True with true.
      Skip *.py, *.php, lib/* files.
      Signed-off-by: default avatarYork Sun <yorksun@freescale.com>
      472d5460