1. 01 10月, 2022 16 次提交
  2. 30 9月, 2022 1 次提交
  3. 29 9月, 2022 3 次提交
  4. 03 8月, 2022 3 次提交
  5. 18 7月, 2022 1 次提交
    • S
      dax: introduce holder for dax_device · 8012b866
      Shiyang Ruan 提交于
      Patch series "v14 fsdax-rmap + v11 fsdax-reflink", v2.
      
      The patchset fsdax-rmap is aimed to support shared pages tracking for
      fsdax.
      
      It moves owner tracking from dax_assocaite_entry() to pmem device driver,
      by introducing an interface ->memory_failure() for struct pagemap.  This
      interface is called by memory_failure() in mm, and implemented by pmem
      device.
      
      Then call holder operations to find the filesystem which the corrupted
      data located in, and call filesystem handler to track files or metadata
      associated with this page.
      
      Finally we are able to try to fix the corrupted data in filesystem and do
      other necessary processing, such as killing processes who are using the
      files affected.
      
      The call trace is like this:
      memory_failure()
      |* fsdax case
      |------------
      |pgmap->ops->memory_failure()      => pmem_pgmap_memory_failure()
      | dax_holder_notify_failure()      =>
      |  dax_device->holder_ops->notify_failure() =>
      |                                     - xfs_dax_notify_failure()
      |  |* xfs_dax_notify_failure()
      |  |--------------------------
      |  |   xfs_rmap_query_range()
      |  |    xfs_dax_failure_fn()
      |  |    * corrupted on metadata
      |  |       try to recover data, call xfs_force_shutdown()
      |  |    * corrupted on file data
      |  |       try to recover data, call mf_dax_kill_procs()
      |* normal case
      |-------------
      |mf_generic_kill_procs()
      
      
      The patchset fsdax-reflink attempts to add CoW support for fsdax, and
      takes XFS, which has both reflink and fsdax features, as an example.
      
      One of the key mechanisms needed to be implemented in fsdax is CoW.  Copy
      the data from srcmap before we actually write data to the destination
      iomap.  And we just copy range in which data won't be changed.
      
      Another mechanism is range comparison.  In page cache case, readpage() is
      used to load data on disk to page cache in order to be able to compare
      data.  In fsdax case, readpage() does not work.  So, we need another
      compare data with direct access support.
      
      With the two mechanisms implemented in fsdax, we are able to make reflink
      and fsdax work together in XFS.
      
      
      This patch (of 14):
      
      To easily track filesystem from a pmem device, we introduce a holder for
      dax_device structure, and also its operation.  This holder is used to
      remember who is using this dax_device:
      
       - When it is the backend of a filesystem, the holder will be the
         instance of this filesystem.
       - When this pmem device is one of the targets in a mapped device, the
         holder will be this mapped device.  In this case, the mapped device
         has its own dax_device and it will follow the first rule.  So that we
         can finally track to the filesystem we needed.
      
      The holder and holder_ops will be set when filesystem is being mounted,
      or an target device is being activated.
      
      Link: https://lkml.kernel.org/r/20220603053738.1218681-1-ruansy.fnst@fujitsu.com
      Link: https://lkml.kernel.org/r/20220603053738.1218681-2-ruansy.fnst@fujitsu.comSigned-off-by: NShiyang Ruan <ruansy.fnst@fujitsu.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NDan Williams <dan.j.wiliams@intel.com>
      Reviewed-by: NDarrick J. Wong <djwong@kernel.org>
      Cc: Dave Chinner <david@fromorbit.com>
      Cc: Jane Chu <jane.chu@oracle.com>
      Cc: Goldwyn Rodrigues <rgoldwyn@suse.de>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Naoya Horiguchi <naoya.horiguchi@nec.com>
      Cc: Miaohe Lin <linmiaohe@huawei.com>
      Cc: Dan Williams <dan.j.williams@intel.com>
      Cc: Goldwyn Rodrigues <rgoldwyn@suse.com>
      Cc: Ritesh Harjani <riteshh@linux.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      8012b866
  6. 15 7月, 2022 2 次提交
  7. 19 6月, 2022 2 次提交
    • E
      ext4: fix up test_dummy_encryption handling for new mount API · 85456054
      Eric Biggers 提交于
      Since ext4 was converted to the new mount API, the test_dummy_encryption
      mount option isn't being handled entirely correctly, because the needed
      fscrypt_set_test_dummy_encryption() helper function combines
      parsing/checking/applying into one function.  That doesn't work well
      with the new mount API, which split these into separate steps.
      
      This was sort of okay anyway, due to the parsing logic that was copied
      from fscrypt_set_test_dummy_encryption() into ext4_parse_param(),
      combined with an additional check in ext4_check_test_dummy_encryption().
      However, these overlooked the case of changing the value of
      test_dummy_encryption on remount, which isn't allowed but ext4 wasn't
      detecting until ext4_apply_options() when it's too late to fail.
      Another bug is that if test_dummy_encryption was specified multiple
      times with an argument, memory was leaked.
      
      Fix this up properly by using the new helper functions that allow
      splitting up the parse/check/apply steps for test_dummy_encryption.
      
      Fixes: cebe85d5 ("ext4: switch to the new mount api")
      Signed-off-by: NEric Biggers <ebiggers@google.com>
      Link: https://lore.kernel.org/r/20220526040412.173025-1-ebiggers@kernel.orgSigned-off-by: NTheodore Ts'o <tytso@mit.edu>
      85456054
    • Y
      ext4: fix super block checksum incorrect after mount · 9b6641dd
      Ye Bin 提交于
      We got issue as follows:
      [home]# mount  /dev/sda  test
      EXT4-fs (sda): warning: mounting fs with errors, running e2fsck is recommended
      [home]# dmesg
      EXT4-fs (sda): warning: mounting fs with errors, running e2fsck is recommended
      EXT4-fs (sda): Errors on filesystem, clearing orphan list.
      EXT4-fs (sda): recovery complete
      EXT4-fs (sda): mounted filesystem with ordered data mode. Quota mode: none.
      [home]# debugfs /dev/sda
      debugfs 1.46.5 (30-Dec-2021)
      Checksum errors in superblock!  Retrying...
      
      Reason is ext4_orphan_cleanup will reset ‘s_last_orphan’ but not update
      super block checksum.
      
      To solve above issue, defer update super block checksum after
      ext4_orphan_cleanup.
      Signed-off-by: NYe Bin <yebin10@huawei.com>
      Cc: stable@kernel.org
      Reviewed-by: NJan Kara <jack@suse.cz>
      Reviewed-by: NRitesh Harjani <ritesh.list@gmail.com>
      Link: https://lore.kernel.org/r/20220525012904.1604737-1-yebin10@huawei.comSigned-off-by: NTheodore Ts'o <tytso@mit.edu>
      9b6641dd
  8. 16 6月, 2022 1 次提交
  9. 25 5月, 2022 2 次提交
    • E
      ext4: only allow test_dummy_encryption when supported · 5f41fdae
      Eric Biggers 提交于
      Make the test_dummy_encryption mount option require that the encrypt
      feature flag be already enabled on the filesystem, rather than
      automatically enabling it.  Practically, this means that "-O encrypt"
      will need to be included in MKFS_OPTIONS when running xfstests with the
      test_dummy_encryption mount option.  (ext4/053 also needs an update.)
      
      Moreover, as long as the preconditions for test_dummy_encryption are
      being tightened anyway, take the opportunity to start rejecting it when
      !CONFIG_FS_ENCRYPTION rather than ignoring it.
      
      The motivation for requiring the encrypt feature flag is that:
      
      - Having the filesystem auto-enable feature flags is problematic, as it
        bypasses the usual sanity checks.  The specific issue which came up
        recently is that in kernel versions where ext4 supports casefold but
        not encrypt+casefold (v5.1 through v5.10), the kernel will happily add
        the encrypt flag to a filesystem that has the casefold flag, making it
        unmountable -- but only for subsequent mounts, not the initial one.
        This confused the casefold support detection in xfstests, causing
        generic/556 to fail rather than be skipped.
      
      - The xfstests-bld test runners (kvm-xfstests et al.) already use the
        required mkfs flag, so they will not be affected by this change.  Only
        users of test_dummy_encryption alone will be affected.  But, this
        option has always been for testing only, so it should be fine to
        require that the few users of this option update their test scripts.
      
      - f2fs already requires it (for its equivalent feature flag).
      Signed-off-by: NEric Biggers <ebiggers@google.com>
      Reviewed-by: NGabriel Krisman Bertazi <krisman@collabora.com>
      Link: https://lore.kernel.org/r/20220519204437.61645-1-ebiggers@kernel.orgSigned-off-by: NTheodore Ts'o <tytso@mit.edu>
      5f41fdae
    • T
      ext4: filter out EXT4_FC_REPLAY from on-disk superblock field s_state · c878bea3
      Theodore Ts'o 提交于
      The EXT4_FC_REPLAY bit in sbi->s_mount_state is used to indicate that
      we are in the middle of replay the fast commit journal.  This was
      actually a mistake, since the sbi->s_mount_info is initialized from
      es->s_state.  Arguably s_mount_state is misleadingly named, but the
      name is historical --- s_mount_state and s_state dates back to ext2.
      
      What should have been used is the ext4_{set,clear,test}_mount_flag()
      inline functions, which sets EXT4_MF_* bits in sbi->s_mount_flags.
      
      The problem with using EXT4_FC_REPLAY is that a maliciously corrupted
      superblock could result in EXT4_FC_REPLAY getting set in
      s_mount_state.  This bypasses some sanity checks, and this can trigger
      a BUG() in ext4_es_cache_extent().  As a easy-to-backport-fix, filter
      out the EXT4_FC_REPLAY bit for now.  We should eventually transition
      away from EXT4_FC_REPLAY to something like EXT4_MF_REPLAY.
      
      Cc: stable@kernel.org
      Signed-off-by: NTheodore Ts'o <tytso@mit.edu>
      Link: https://lore.kernel.org/r/20220420192312.1655305-1-phind.uet@gmail.com
      Link: https://lore.kernel.org/r/20220517174028.942119-1-tytso@mit.edu
      Reported-by: syzbot+c7358a3cd05ee786eb31@syzkaller.appspotmail.com
      c878bea3
  10. 22 5月, 2022 1 次提交
  11. 18 5月, 2022 3 次提交
  12. 14 5月, 2022 1 次提交
  13. 12 5月, 2022 1 次提交
  14. 11 5月, 2022 1 次提交
  15. 18 4月, 2022 1 次提交
  16. 15 4月, 2022 1 次提交