1. 16 Apr, 2023 4 commits
  2. 15 Feb, 2023 2 commits
  3. 16 Jan, 2023 1 commit
  4. 07 Dec, 2022 1 commit
    • Hou Tao's avatar
      erofs: check the uniqueness of fsid in shared domain in advance · 27f2a2dc
      Hou Tao authored
      
      When shared domain is enabled, doing mount twice with the same fsid and
      domain_id will trigger sysfs warning as shown below:
      
       sysfs: cannot create duplicate filename '/fs/erofs/d0,meta.bin'
       CPU: 15 PID: 1051 Comm: mount Not tainted 6.1.0-rc6+ #1
       Hardware name: QEMU Standard PC (i440FX + PIIX, 1996)
       Call Trace:
        <TASK>
        dump_stack_lvl+0x38/0x49
        dump_stack+0x10/0x12
        sysfs_warn_dup.cold+0x17/0x27
        sysfs_create_dir_ns+0xb8/0xd0
        kobject_add_internal+0xb1/0x240
        kobject_init_and_add+0x71/0xa0
        erofs_register_sysfs+0x89/0x110
        erofs_fc_fill_super+0x98c/0xaf0
        vfs_get_super+0x7d/0x100
        get_tree_nodev+0x16/0x20
        erofs_fc_get_tree+0x20/0x30
        vfs_get_tree+0x24/0xb0
        path_mount+0x2fa/0xa90
        do_mount+0x7c/0xa0
        __x64_sys_mount+0x8b/0xe0
        do_syscall_64+0x30/0x60
        entry_SYSCALL_64_after_hwframe+0x46/0xb0
      
      The reason is erofs_fscache_register_cookie() doesn't guarantee the primary
      data blob (aka fsid) is unique in the shared domain and
      erofs_register_sysfs() invoked by the second mount will fail due to the
      duplicated fsid in the shared domain and report warning.
      
      It would be better to check the uniqueness of fsid before doing
      erofs_register_sysfs(), so adding a new flags parameter for
      erofs_fscache_register_cookie() and doing the uniqueness check if
      EROFS_REG_COOKIE_NEED_NOEXIST is enabled.
      
      After the patch, the error in dmesg for the duplicated mount would be:
      
       erofs: ...: erofs_domain_register_cookie: XX already exists in domain YY
      Reviewed-by: default avatarJia Zhu <zhujia.zj@bytedance.com>
      Reviewed-by: default avatarJingbo Xu <jefflexu@linux.alibaba.com>
      Reviewed-by: default avatarChao Yu <chao@kernel.org>
      Signed-off-by: default avatarHou Tao <houtao1@huawei.com>
      Link: https://lore.kernel.org/r/20221125110822.3812942-1-houtao@huaweicloud.com
      Fixes: 7d419637
      
       ("erofs: Support sharing cookies in the same domain")
      Signed-off-by: default avatarGao Xiang <hsiangkao@linux.alibaba.com>
      27f2a2dc
  5. 10 Nov, 2022 1 commit
  6. 27 Sep, 2022 1 commit
  7. 26 Sep, 2022 2 commits
  8. 20 Sep, 2022 4 commits
  9. 18 Jul, 2022 1 commit
    • Shiyang Ruan's avatar
      dax: introduce holder for dax_device · 8012b866
      Shiyang Ruan authored
      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.com
      
      Signed-off-by: default avatarShiyang Ruan <ruansy.fnst@fujitsu.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Reviewed-by: default avatarDan Williams <dan.j.wiliams@intel.com>
      Reviewed-by: default avatarDarrick 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: default avatarAndrew Morton <akpm@linux-foundation.org>
      8012b866
  10. 17 May, 2022 9 commits
  11. 10 May, 2022 1 commit
  12. 22 Mar, 2022 1 commit
    • Muchun Song's avatar
      fs: allocate inode by using alloc_inode_sb() · fd60b288
      Muchun Song authored
      The inode allocation is supposed to use alloc_inode_sb(), so convert
      kmem_cache_alloc() of all filesystems to alloc_inode_sb().
      
      Link: https://lkml.kernel.org/r/20220228122126.37293-5-songmuchun@bytedance.com
      
      Signed-off-by: default avatarMuchun Song <songmuchun@bytedance.com>
      Acked-by: Theodore Ts'o <tytso@mit.edu>		[ext4]
      Acked-by: default avatarRoman Gushchin <roman.gushchin@linux.dev>
      Cc: Alex Shi <alexs@kernel.org>
      Cc: Anna Schumaker <Anna.Schumaker@Netapp.com>
      Cc: Chao Yu <chao@kernel.org>
      Cc: Dave Chinner <david@fromorbit.com>
      Cc: Fam Zheng <fam.zheng@bytedance.com>
      Cc: Jaegeuk Kim <jaegeuk@kernel.org>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: Kari Argillander <kari.argillander@gmail.com>
      Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
      Cc: Michal Hocko <mhocko@kernel.org>
      Cc: Qi Zheng <zhengqi.arch@bytedance.com>
      Cc: Shakeel Butt <shakeelb@google.com>
      Cc: Trond Myklebust <trond.myklebust@hammerspace.com>
      Cc: Vladimir Davydov <vdavydov.dev@gmail.com>
      Cc: Vlastimil Babka <vbabka@...
      fd60b288
  13. 16 Mar, 2022 2 commits
  14. 15 Mar, 2022 1 commit
  15. 04 Jan, 2022 1 commit
  16. 30 Dec, 2021 1 commit
  17. 08 Dec, 2021 2 commits
  18. 04 Dec, 2021 2 commits
  19. 19 Oct, 2021 1 commit
    • Gao Xiang's avatar
      erofs: lzma compression support · 622ceadd
      Gao Xiang authored
      Add MicroLZMA support in order to maximize compression ratios for
      specific scenarios. For example, it's useful for low-end embedded
      boards and as a secondary algorithm in a file for specific access
      patterns.
      
      MicroLZMA is a new container format for raw LZMA1, which was created
      by Lasse Collin aiming to minimize old LZMA headers and get rid of
      unnecessary EOPM (end of payload marker) as well as to enable
      fixed-sized output compression, especially for 4KiB pclusters.
      
      Similar to LZ4, inplace I/O approach is used to minimize runtime
      memory footprint when dealing with I/O. Overlapped decompression is
      handled with 1) bounced buffer for data under processing or 2) extra
      short-lived pages from the on-stack pagepool which will be shared in
      the same read request (128KiB for example).
      
      Link: https://lore.kernel.org/r/20211010213145.17462-8-xiang@kernel.org
      
      Acked-by: default avatarChao Yu <chao@kernel.org>
      Signed-off-by: default avatarGao Xiang <hsiangkao@linux.alibaba.com>
      622ceadd
  20. 17 Oct, 2021 2 commits