Skip to content

Redfs support for rhel kernel-5.14.0-570.12.1.el9_6 - #10

Merged
bsbernd merged 11 commits into
DDNStorage:redfs-rhel9_6-570.12.1from
jianhuangli:redfs-rhel9_6-570.12.1
Aug 6, 2025
Merged

bsbernd merged 11 commits into
DDNStorage:redfs-rhel9_6-570.12.1from
jianhuangli:redfs-rhel9_6-570.12.1

Conversation

@jianhuangli

@jianhuangli jianhuangli commented Jul 29, 2025 •

Copy link
Copy Markdown

This is the cherry-picks based on branch redfs-ubuntu-noble-6.8.0-58.60@62241a58cec8

Test Results,

xfstests-rocky96-uring-dio-2507261023.log:Failures: generic/099 generic/120 generic/193 generic/263 generic/317 generic/318 generic/319 generic/346 generic/355 generic/375 generic/389 generic/444 generic/617 generic/631 generic/633 generic/647 generic/683 generic/697 generic/729
xfstests-rocky96-uring-dio-2507261023.log-Failed 19 of 756 tests
--
xfstests-rocky96-uring-dio-2507261023.log:Failures: generic/521
xfstests-rocky96-uring-dio-2507261023.log-Failed 1 of 2 tests
--
xfstests-rocky96-uring-nodio-2507260307.log:Failures: generic/099 generic/192 generic/209 generic/263 generic/317 generic/318 generic/319 generic/355 generic/363 generic/366 generic/375 generic/389 generic/444 generic/451 generic/531 generic/617 generic/631 generic/633 generic/647 generic/683 generic/697 generic/729
xfstests-rocky96-uring-nodio-2507260307.log-Failed 22 of 755 tests
--
xfstests-rocky96-uring-nodio-2507260307.log:Failures: generic/521
xfstests-rocky96-uring-nodio-2507260307.log-Failed 1 of 2 tests
--
xfstests-rocky96-without-uring-dio-2507251608.log:Failures: generic/099 generic/120 generic/193 generic/263 generic/317 generic/318 generic/319 generic/344 generic/346 generic/355 generic/375 generic/389 generic/444 generic/531 generic/617 generic/631 generic/633 generic/647 generic/683 generic/697 generic/729
xfstests-rocky96-without-uring-dio-2507251608.log-Failed 21 of 756 tests
--
xfstests-rocky96-without-uring-dio-2507251608.log:Failures: generic/521
xfstests-rocky96-without-uring-dio-2507251608.log-Failed 1 of 2 tests
--
xfstests-rocky96-without-uring-nodio-2507251454.log:Failures: generic/099 generic/192 generic/209 generic/263 generic/317 generic/318 generic/319 generic/355 generic/363 generic/366 generic/375 generic/389 generic/444 generic/451 generic/531 generic/617 generic/631 generic/633 generic/647 generic/683 generic/697 generic/729
xfstests-rocky96-without-uring-nodio-2507251454.log-Failed 22 of 755 tests
--
xfstests-rocky96-without-uring-nodio-2507251454.log:Failures: generic/521
xfstests-rocky96-without-uring-nodio-2507251454.log-Failed 1 of 2 tests

bsbernd and others added 11 commits July 24, 2025 03:22
When having writeback cache enabled it is beneficial for data consistency
to communicate to the FUSE server when the kernel prepares a page for caching.
This lets the FUSE server react and lock the page.

Additionally the kernel lets the FUSE server decide how much data it locks by the
same call and keeps the given information in the dlm lock management.

If the feature is not supported it will be disabled after first unsuccessful use.

- Add DLM_LOCK fuse opcode
- Add cache page lock caching for writeback cache functionality.
This means sending out a FUSE call whenever the kernel prepares a page
for writeback cache. The kernel will manage the cache so that it will keep
track of already acquired locks.
(except for the case that is documented in the code)
- Use rb-trees for the management of the already 'locked' page ranges
- Use rw_semaphore for synchronization in fuse_dlm_cache

(cherry picked from commit 287c884)
Add support to invalidate inode aliases when doing inode invalidation.
This is useful for distributed file systems, which use DLM for cache
coherency. So, when a client losts its inode lock, it should invalidate
its inode cache and dentry cache since the other client may delete
this file after getting inode lock.

Signed-off-by: Yong Ze Chen <yochen@ddn.com>
(cherry picked from commit 49720b5)
Renumber the operation code to a high value to avoid conflicts with upstream.

(cherry picked from commit 27a0e9e)
Send a DLM_WB_LOCK request in the page_mkwrite handler to enable FUSE
filesystems to acquire a distributed lock manager (DLM) lock for
protecting upcoming dirty pages when a previously read-only mapped
page is about to be written.

Signed-off-by: Cheng Ding <cding@ddn.com>
(cherry picked from commit ec36c45)
Allow read_folio to return EAGAIN error and translate it to
AOP_TRUNCATE_PAGE to retry page fault and read operations.
This is used to prevent deadlock of folio lock/DLM lock order reversal:
 - Fault or read operations acquire folio lock first, then DLM lock.
 - FUSE daemon blocks new DLM lock acquisition while it invalidating
   page cache. invalidate_inode_pages2_range() acquires folio lock
To prevent deadlock, the FUSE daemon will fail its DLM lock acquisition
with EAGAIN if it detects an in-flight page cache invalidating
operation.

Signed-off-by: Cheng Ding <cding@ddn.com>
(cherry picked from commit 8ecf118)
generic/488 fails with fuse2fs in the following fashion:

generic/488       _check_generic_filesystem: filesystem on /dev/sdf is inconsistent
(see /var/tmp/fstests/generic/488.full for details)

This test opens a large number of files, unlinks them (which really just
renames them to fuse hidden files), closes the program, unmounts the
filesystem, and runs fsck to check that there aren't any inconsistencies
in the filesystem.

Unfortunately, the 488.full file shows that there are a lot of hidden
files left over in the filesystem, with incorrect link counts.  Tracing
fuse_request_* shows that there are a large number of FUSE_RELEASE
commands that are queued up on behalf of the unlinked files at the time
that fuse_conn_destroy calls fuse_abort_conn.  Had the connection not
aborted, the fuse server would have responded to the RELEASE commands by
removing the hidden files; instead they stick around.

Create a function to push all the background requests to the queue and
then wait for the number of pending events to hit zero, and call this
before fuse_abort_conn.  That way, all the pending events are processed
by the fuse server and we don't end up with a corrupt filesystem.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
(cherry picked from commit d4262f9)
This is a preparation to allow fuse-io-uring bg queue
flush from flush_bg_queue()

This does two function renames:
fuse_uring_flush_bg -> fuse_uring_flush_queue_bg
fuse_uring_abort_end_requests -> fuse_uring_flush_bg

And fuse_uring_abort_end_queue_requests() is moved to
fuse_uring_stop_queues().

Signed-off-by: Bernd Schubert <bschubert@ddn.com>
(cherry picked from commit e70ef24)
This is useful to have a unique API to flush background requests.
For example when the bg queue gets flushed before
the remaining of fuse_conn_destroy().

Signed-off-by: Bernd Schubert <bschubert@ddn.com>
(cherry picked from commit fc4120c)
When writing back pages while using writeback caching the code did a copy of data into
temporary pages to avoid a deadlock in reclaiming of memory.

This is an adaptation and backport of a patch by Joanne Koong joannelkoong@gmail.com.

Since we use pinned memory with io_uring we don't need the temporary copies
and we don't use the AS_WRITEBACK_MAY_DEADLOCK_ON_RECLAIM flag in the pagemap.

Link: https://www.spinics.net/lists/linux-mm/msg407405.html
Signed-off-by: Horst Birthelmer <hbirthelmer@ddn.com>
(cherry picked from commit 114c4df)
When calling the fuse server with a dlm request and the fuse server
responds with some other error than ENOSYS most likely the lock size
will be set to zero. In that case the kernel will abort the fuse
connection. This is completely unnecessary.

Signed-off-by: Horst Birthelmer <hbirthelmer@ddn.com>
(cherry picked from commit 0bc2f9c)
Check whether dlm is still enabled when interpreting the returned
error from fuse server.

Signed-off-by: Horst Birthelmer <hbirthelmer@ddn.com>
(cherry picked from commit f6fbf7c)
@jianhuangli
jianhuangli requested review from bsbernd and openunix July 29, 2025 03:06
@jianhuangli jianhuangli changed the title Redfs support for rhel kernel-5.14.0-570.12.1.el9_6Redfs rhel9 6 570.12.1 Redfs support for rhel kernel-5.14.0-570.12.1.el9_6 Jul 29, 2025
@bsbernd
bsbernd merged commit 5d56aeb into DDNStorage:redfs-rhel9_6-570.12.1 Aug 6, 2025
github-actions Bot pushed a commit to openunix/linux that referenced this pull request May 2, 2026
ice_reset_all_vfs() ignores the return value of ice_vf_rebuild_vsi().
When the VSI rebuild fails (e.g. during NVM firmware update via
nvmupdate64e), ice_vsi_rebuild() tears down the VSI on its error path,
leaving txq_map and rxq_map as NULL. The subsequent unconditional call
to ice_vf_post_vsi_rebuild() leads to a NULL pointer dereference in
ice_ena_vf_q_mappings() when it accesses vsi->txq_map[0].

The single-VF reset path in ice_reset_vf() already handles this
correctly by checking the return value of ice_vf_reconfig_vsi() and
skipping ice_vf_post_vsi_rebuild() on failure.

Apply the same pattern to ice_reset_all_vfs(): check the return value
of ice_vf_rebuild_vsi() and skip ice_vf_post_vsi_rebuild() and
ice_eswitch_attach_vf() on failure. The VF is left safely disabled
(ICE_VF_STATE_INIT not set, VFGEN_RSTAT not set to VFACTIVE) and can
be recovered via a VFLR triggered by a PCI reset of the VF
(sysfs reset or driver rebind).

Note that this patch does not prevent the VF VSI rebuild from failing
during NVM update — the underlying cause is firmware being in a
transitional state while the EMP reset is processed, which can cause
Admin Queue commands (ice_add_vsi, ice_cfg_vsi_lan) to fail. This
patch only prevents the subsequent NULL pointer dereference that
crashes the kernel when the rebuild does fail.

 crash> bt
     PID: 50795    TASK: ff34c9ee708dc680  CPU: 1    COMMAND: "kworker/u512:5"
      #0 [ff72159bcfe5bb50] machine_kexec at ffffffffaa8850ee
      #1 [ff72159bcfe5bba8] __crash_kexec at ffffffffaaa15fba
      DDNStorage#2 [ff72159bcfe5bc68] crash_kexec at ffffffffaaa16540
      DDNStorage#3 [ff72159bcfe5bc70] oops_end at ffffffffaa837eda
      DDNStorage#4 [ff72159bcfe5bc90] page_fault_oops at ffffffffaa893997
      DDNStorage#5 [ff72159bcfe5bce8] exc_page_fault at ffffffffab528595
      DDNStorage#6 [ff72159bcfe5bd10] asm_exc_page_fault at ffffffffab600bb2
         [exception RIP: ice_ena_vf_q_mappings+0x79]
         RIP: ffffffffc0a85b29  RSP: ff72159bcfe5bdc8  RFLAGS: 00010206
         RAX: 00000000000f0000  RBX: ff34c9efc9c00000  RCX: 0000000000000000
         RDX: 0000000000000000  RSI: 0000000000000010  RDI: ff34c9efc9c00000
         RBP: ff34c9efc27d4828   R8: 0000000000000093   R9: 0000000000000040
         R10: ff34c9efc27d4828  R11: 0000000000000040  R12: 0000000000100000
         R13: 0000000000000010  R14:   R15:
         ORIG_RAX: ffffffffffffffff  CS: 0010  SS: 0018
      DDNStorage#7 [ff72159bcfe5bdf8] ice_sriov_post_vsi_rebuild at ffffffffc0a85e2e [ice]
      DDNStorage#8 [ff72159bcfe5be08] ice_reset_all_vfs at ffffffffc0a920b4 [ice]
      DDNStorage#9 [ff72159bcfe5be48] ice_service_task at ffffffffc0a31519 [ice]
     DDNStorage#10 [ff72159bcfe5be88] process_one_work at ffffffffaa93dca4
     DDNStorage#11 [ff72159bcfe5bec8] worker_thread at ffffffffaa93e9de
     DDNStorage#12 [ff72159bcfe5bf18] kthread at ffffffffaa946663
     DDNStorage#13 [ff72159bcfe5bf50] ret_from_fork at ffffffffaa8086b9

 The panic occurs attempting to dereference the NULL pointer in RDX at
 ice_sriov.c:294, which loads vsi->txq_map (offset 0x4b8 in ice_vsi).

 The faulting VSI is an allocated slab object but not fully initialized
 after a failed ice_vsi_rebuild():

  crash> struct ice_vsi 0xff34c9efc27d4828
    netdev = 0x0,
    rx_rings = 0x0,
    tx_rings = 0x0,
    q_vectors = 0x0,
    txq_map = 0x0,
    rxq_map = 0x0,
    alloc_txq = 0x10,
    num_txq = 0x10,
    alloc_rxq = 0x10,
    num_rxq = 0x10,

 The nvmupdate64e process was performing NVM firmware update:

  crash> bt 0xff34c9edd1a30000
  PID: 49858    TASK: ff34c9edd1a30000  CPU: 1    COMMAND: "nvmupdate64e"
   #0 [ff72159bcd617618] __schedule at ffffffffab5333f8
   DDNStorage#4 [ff72159bcd617750] ice_sq_send_cmd at ffffffffc0a35347 [ice]
   DDNStorage#5 [ff72159bcd6177a8] ice_sq_send_cmd_retry at ffffffffc0a35b47 [ice]
   DDNStorage#6 [ff72159bcd617810] ice_aq_send_cmd at ffffffffc0a38018 [ice]
   DDNStorage#7 [ff72159bcd617848] ice_aq_read_nvm at ffffffffc0a40254 [ice]
   DDNStorage#8 [ff72159bcd6178b8] ice_read_flat_nvm at ffffffffc0a4034c [ice]
   DDNStorage#9 [ff72159bcd617918] ice_devlink_nvm_snapshot at ffffffffc0a6ffa5 [ice]

 dmesg:
  ice 0000:13:00.0: firmware recommends not updating fw.mgmt, as it
    may result in a downgrade. continuing anyways
  ice 0000:13:00.1: ice_init_nvm failed -5
  ice 0000:13:00.1: Rebuild failed, unload and reload driver

Fixes: 12bb018 ("ice: Refactor VF reset")
Signed-off-by: Petr Oros <poros@redhat.com>
Tested-by: Rafal Romanowski <rafal.romanowski@intel.com>
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://patch.msgid.link/20260427-jk-iwl-net-petr-oros-fixes-v1-5-cdcb48303fd8@intel.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants