Skip to content
Snippets Groups Projects
  1. May 06, 2024
  2. Apr 18, 2024
  3. Apr 17, 2024
    • Heinrich Schuchardt's avatar
      fs: fat: fill creation and change date · ba23c378
      Heinrich Schuchardt authored and Tom Rini's avatar Tom Rini committed
      
      The FAT specification requires that the change date is set.
      
      If a DM RTC device exists, set the creation and change date to the current
      date when updating the directory entry. Otherwise use the date 2020-01-01.
      
      Signed-off-by: default avatarHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
      ba23c378
    • Heinrich Schuchardt's avatar
      fs: fat: convert change month correctly · 3c1bc9f1
      Heinrich Schuchardt authored and Tom Rini's avatar Tom Rini committed
      
      The month is stored in 5 - 8. We need to shift it by 5 bits.
      
      Cf. Microsoft FAT Specification, 2005-08-30
      
      Fixes: 13c11c66 ("fs: fat: add file attributes to struct fs_dirent")
      Signed-off-by: default avatarHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
      Reviewed-by: default avatarAlexander Dahl <ada@thorsis.com>
      Reviewed-by: default avatarIlias Apalodimas <ilias.apalodimas@linaro.org>
      3c1bc9f1
    • mwleeds@mailtundra.com's avatar
      zfs: Fix zfs_read() to actually work · 730c69f1
      mwleeds@mailtundra.com authored and Tom Rini's avatar Tom Rini committed
      
      Without this patch, the while loop being modified goes on infinitely,
      but with the patch I am able to boot linux on zfs on a jetson tx2 nx.
      
      It seems like this code was never tested because the logic is clearly
      wrong. The function do_div(a,b) does a division that modifies the first
      parameter to have a = a / b, and returns the remainder of the division.
      So clearly in the usual case when file->offset = 0, the line
      "blkid = do_div(blkid, blksz);" just results in blkid being set to zero
      on every iteration of the loop, rather than being incremented as blocks
      are read. Hence the zeroth block is read over and over and this becomes
      an infinite loop.
      
      So instead capture the remainder of the division in a "blkoff" variable,
      and use that to properly calculate the memory address to move from in
      memmove() below.
      
      For example, if file->offset were 1337, on the first iteration of the
      loop blkid would be 0 and blkoff would be 1337. If the blksz is 131072
      (as it was for me), that amount of data would be copied into
      data->file_buf. movesize would be 131072 - 1337 = 129735 so 129735 bytes
      would be moved into buf. On the second iteration of the loop (assuming
      there is one), red would be 129735, blkid would be 1, blkoff would be 0,
      and 131072 bytes would be copied into buf. And so on...
      
      Signed-off-by: default avatarPhaedrus Leeds <mwleeds@mailtundra.com>
      730c69f1
    • mwleeds@mailtundra.com's avatar
      zfs: Fix return value of fs_devread() · 1e85ddb7
      mwleeds@mailtundra.com authored and Tom Rini's avatar Tom Rini committed
      
      As evidenced by how other filesystems handle it, a return value of 0
      from fs_devread() means failure; nonzero means success. The opposite
      assumption was being made in zfs.c for the use of zfs_devread() so fix
      the confusion by making zfs_devread() return 0 on success.
      
      It probably doesn't make sense to change the handling of zfs_devread()
      in zfs.c instead, because as it is it matches the semantics of the other
      functions there.
      
      Signed-off-by: default avatarPhaedrus Leeds <mwleeds@mailtundra.com>
      1e85ddb7
    • mwleeds@mailtundra.com's avatar
      zfs: Fix unaligned read of uint64 · 1fe745b4
      mwleeds@mailtundra.com authored and Tom Rini's avatar Tom Rini committed
      
      Without this patch, when trying to boot zfs using U-Boot on a Jetson TX2
      NX (which is aarch64), I get a CPU reset error like so:
      
      "Synchronous Abort" handler, esr 0x96000021
      elr: 00000000800c9000 lr : 00000000800c8ffc (reloc)
      elr: 00000000fff77000 lr : 00000000fff76ffc
      x0 : 00000000ffb40f04 x1 : 0000000000000000
      x2 : 000000000000000a x3 : 0000000003100000
      x4 : 0000000003100000 x5 : 0000000000000034
      x6 : 00000000fff9cc6e x7 : 000000000000000f
      x8 : 00000000ff7f84a0 x9 : 0000000000000008
      x10: 00000000ffb40f04 x11: 0000000000000006
      x12: 000000000001869f x13: 0000000000000001
      x14: 00000000ff7f84bc x15: 0000000000000010
      x16: 0000000000002080 x17: 00000000001fffff
      x18: 00000000ff7fbdd8 x19: 00000000ffb405f8
      x20: 00000000ffb40dd0 x21: 00000000fffabe5e
      x22: 000000ea77940000 x23: 00000000ffb42090
      x24: 0000000000000000 x25: 0000000000000000
      x26: 0000000000000000 x27: 0000000000000000
      x28: 0000000000bab10c x29: 00000000ff7f85f0
      
      Code: d00001a0 9103a000 94006ac6 f9401ba0 (f9400000)
      Resetting CPU ...
      
      This happens when be64_to_cpu() is called on a value that exists at a
      memory address that's 4 byte aligned but not 8 byte aligned (e.g. an
      address ending in 04). The call stack where that happens is:
      check_pool_label() ->
      zfs_nvlist_lookup_uint64(vdevnvlist, ZPOOL_CONFIG_ASHIFT,...) ->
      be64_to_cpu()
      
      Signed-off-by: default avatarPhaedrus Leeds <mwleeds@mailtundra.com>
      Fixes: 4d3c95f5 ("zfs: Add ZFS filesystem support")
      1fe745b4
    • mwleeds@mailtundra.com's avatar
      zfs: Add a comment to clarify nvlist memory layout · 6bbd7e82
      mwleeds@mailtundra.com authored and Tom Rini's avatar Tom Rini committed
      
      Signed-off-by: default avatarPhaedrus Leeds <mwleeds@mailtundra.com>
      6bbd7e82
    • mwleeds@mailtundra.com's avatar
      zfs: Fix malloc() success check · 0c17f857
      mwleeds@mailtundra.com authored and Tom Rini's avatar Tom Rini committed
      
      This code was hitting the error code path whenever malloc() succeeded
      rather than when it failed, so presumably this part of the code hasn't
      been tested. I had to apply this fix (and others) to get U-Boot to boot
      from ZFS on an Nvidia Jetson TX2 NX SoM (an aarch64 computer).
      
      Signed-off-by: default avatarPhaedrus Leeds <mwleeds@mailtundra.com>
      0c17f857
  4. Apr 10, 2024
  5. Mar 04, 2024
  6. Jan 17, 2024
  7. Dec 21, 2023
  8. Dec 13, 2023
  9. Nov 29, 2023
  10. Nov 16, 2023
  11. Oct 30, 2023
  12. Oct 18, 2023
  13. Sep 24, 2023
  14. Sep 14, 2023
  15. Aug 25, 2023
  16. Aug 19, 2023
  17. Aug 14, 2023
  18. Aug 08, 2023
  19. Aug 07, 2023
Loading