Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

hbirth
Copy link
Collaborator

@hbirth hbirth commented Jul 8, 2025

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.

Since we use pinned memory with io_uring we don't need the temporary copies.

@hbirth hbirth requested a review from bsbernd July 8, 2025 14:02
Copy link
Collaborator

@bsbernd bsbernd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to test this severely through xfstests. @hbirth I think there are missing flags for the mm system that we cannot backport - could add in the commit message which parts you couldn't backport and also add a link to the patch you took the main changes from?

@hbirth
Copy link
Collaborator Author

hbirth commented Jul 10, 2025

We need to test this severely through xfstests. @hbirth I think there are missing flags for the mm system that we cannot backport - could add in the commit message which parts you couldn't backport and also add a link to the patch you took the main changes from?

I do xfstests ATM. With KASAN it takes a very long time ... so I will do with and without to save some time. Will do the documentation after some of the testing.

Darrick J. Wong and others added 4 commits July 20, 2025 09:41
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 [email protected].

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 <[email protected]>
@hbirth hbirth force-pushed the redfs-ubuntu-6.8.0 branch from e91ec80 to 114c4df Compare July 20, 2025 07:55
hbirth added 2 commits July 21, 2025 15:54
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 <[email protected]>
Check whether dlm is still enabled when interpreting the returned
error from fuse server.

Signed-off-by: Horst Birthelmer <[email protected]>
@hbirth hbirth requested review from bsbernd and cding-ddn July 21, 2025 16:23
@cding-ddn
Copy link
Collaborator

The patch fuse: fix connection abort on mmap when fuse server returns ENOSYS looks good, thanks for catching this issue.

@bsbernd bsbernd merged commit 62241a5 into DDNStorage:redfs-ubuntu-noble-6.8.0-58.60 Jul 21, 2025
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.

3 participants