Skip to content
Snippets Groups Projects
  1. Aug 21, 2024
  2. Aug 20, 2024
  3. Aug 16, 2024
  4. Aug 15, 2024
  5. Aug 13, 2024
  6. Aug 12, 2024
  7. Aug 11, 2024
  8. Aug 10, 2024
    • Ravi Minnikanti's avatar
      ubifs: mount fails after power cycle · cf7ea719
      Ravi Minnikanti authored
      
      When kernel uses file system encryption, fscrypt on UBIFS v5,
      after a hard power cycle UBIFS journal replay fails which results in mount failure.
      
      Failure logs:
      UBIFS: recovery needed
      UBIFS error (pid 0): ubifs_validate_entry: bad directory entry node
      UBIFS error (pid 0): replay_bud: bad node is at LEB 890:24576
      UBIFS error (pid 0): ubifs_mount: Error reading superblock on volume 'ubi0:rootfs' errno=-22!
      
      This change is ported from kernel:
      commit id: 304790c038bc4af4f19774705409db27eafb09fc
      
      Kernel commit description:
          Kernel commit description:
          ubifs: Relax checks in ubifs_validate_entry()
      
          With encrypted filenames we store raw binary data, doing
          string tests is no longer possible.
      
      Signed-off-by: default avatarrminnikanti <rminnikanti@marvell.com>
      Reviewed-by: default avatarHeiko Schocher <hs@denx.de>
      cf7ea719
    • Alexander Dahl's avatar
      fs: ubifs: Add volume mounted check · ca1f11d8
      Alexander Dahl authored
      
      Safety guard in the U-Boot filesystem glue code, because these functions
      are called from different parts of the codebase.  For generic filesystem
      handling this should have been checked in blk_get_device_part_str()
      already.  Commands from cmd/ubifs.c should also check this before
      calling those functions, but you never know?!
      
      Signed-off-by: default avatarAlexander Dahl <ada@thorsis.com>
      ca1f11d8
    • Alexander Dahl's avatar
      fs: ubifs: Make k(z)alloc/kfree symmetric · 0989033d
      Alexander Dahl authored
      
      Although kfree() is in fact only a slim wrapper to free() in U-Boot, use
      kfree() here, because those structs where allocated with kalloc() or
      kzalloc().
      
      Signed-off-by: default avatarAlexander Dahl <ada@thorsis.com>
      0989033d
    • Alexander Dahl's avatar
      fs: ubifs: Set pointers to NULL after free · 573dae50
      Alexander Dahl authored
      
      Global superblock pointer 'ubifs_sb' and volume pointer 'ubi' of type
      struct ubi_volume_desc in private member sb->s_fs_info of type struct
      ubifs_info, can be allocated and freed at runtime, and allocated and
      freed again, depending which console or script commands are run.  In
      some cases ubifs_sb is even tested to determine if the filesystem is
      mounted.  Reset those pointers to NULL after free to clearly mark them
      as not valid.  This avoids potential double free on invalid pointers.
      
      (The ubifs_sb pointer was already reset, but that statement was moved
      now to directly after the free() to make it easier to understand.)
      
      Signed-off-by: default avatarAlexander Dahl <ada@thorsis.com>
      573dae50
Loading