1. 14 Sep, 2023 2 commits
    • Jan Kara's avatar
      ext4: move setting of trimmed bit into ext4_try_to_trim_range() · 45e4ab32
      Jan Kara authored
      Currently we set the group's trimmed bit in ext4_trim_all_free() based
      on return value of ext4_try_to_trim_range(). However when we will want
      to abort trimming because of suspend attempt, we want to return success
      from ext4_try_to_trim_range() but not set the trimmed bit. Instead
      implementing awkward propagation of this information, just move setting
      of trimmed bit into ext4_try_to_trim_range() when the whole group is
      trimmed.
      
      Cc: stable@kernel.org
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      Link: https://lore.kernel.org/r/20230913150504.9054-1-jack@suse.czSigned-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      45e4ab32
    • Li Zetao's avatar
      jbd2: Fix memory leak in journal_init_common() · 1bb0763f
      Li Zetao authored
      There is a memory leak reported by kmemleak:
      
        unreferenced object 0xff11000105903b80 (size 64):
          comm "mount", pid 3382, jiffies 4295032021 (age 27.826s)
          hex dump (first 32 bytes):
            04 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00  ................
            ff ff ff ff 00 00 00 00 00 00 00 00 00 00 00 00  ................
          backtrace:
            [<ffffffffae86ac40>] __kmalloc_node+0x50/0x160
            [<ffffffffaf2486d8>] crypto_alloc_tfmmem.isra.0+0x38/0x110
            [<ffffffffaf2498e5>] crypto_create_tfm_node+0x85/0x2f0
            [<ffffffffaf24a92c>] crypto_alloc_tfm_node+0xfc/0x210
            [<ffffffffaedde777>] journal_init_common+0x727/0x1ad0
            [<ffffffffaede1715>] jbd2_journal_init_inode+0x2b5/0x500
            [<ffffffffaed786b5>] ext4_load_and_init_journal+0x255/0x2440
            [<ffffffffaed8b423>] ext4_fill_super+0x8823/0xa330
            ...
      
      The root cause was traced to an error handing path in journal_init_common()
      when malloc memory failed in register_shrinker(). The checksum driver is
      used to reference to checksum algorithm via cryptoapi and the user should
      release the memory when the driver is no longer needed or the journal
      initialization failed.
      
      Fix it by calling crypto_free_shash() on the "err_cleanup" error handing
      path in journal_init_common().
      
      Fixes: c3071308 ("jbd2: move load_superblock() into journal_init_common()")
      Signed-off-by: default avatarLi Zetao <lizetao1@huawei.com>
      Reviewed-by: default avatarJan Kara <jack@suse.cz>
      Reviewed-by: default avatarZhang Yi <yi.zhang@huawei.com>
      Reviewed-by: default avatarRitesh Harjani (IBM) <ritesh.list@gmail.com>
      Link: https://lore.kernel.org/r/20230911025138.983101-1-lizetao1@huawei.comSigned-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      1bb0763f
  2. 07 Sep, 2023 2 commits
  3. 27 Aug, 2023 17 commits
  4. 23 Aug, 2023 2 commits
  5. 15 Aug, 2023 9 commits
  6. 05 Aug, 2023 3 commits
  7. 04 Aug, 2023 3 commits
  8. 03 Aug, 2023 2 commits