Centos-kernel-stream-10/fs/erofs
Paulo Alcantara 53c897163a netfs: Fix the request's work item to not require a ref
JIRA: https://issues.redhat.com/browse/RHEL-96872
Conflicts:
	- Code difference due to 3dc00bca8dc8 ("fs/netfs: remove
          `netfs_io_request.ractl`").

commit 20d72b00ca814d748f5663484e5c53bb2bf37a3a
Author: David Howells <dhowells@redhat.com>
Date:   Mon May 19 10:07:03 2025 +0100

    netfs: Fix the request's work item to not require a ref

    When the netfs_io_request struct's work item is queued, it must be supplied
    with a ref to the work item struct to prevent it being deallocated whilst
    on the queue or whilst it is being processed.  This is tricky to manage as
    we have to get a ref before we try and queue it and then we may find it's
    already queued and is thus already holding a ref - in which case we have to
    try and get rid of the ref again.

    The problem comes if we're in BH or IRQ context and need to drop the ref:
    if netfs_put_request() reduces the count to 0, we have to do the cleanup -
    but the cleanup may need to wait.

    Fix this by adding a new work item to the request, ->cleanup_work, and
    dispatching that when the refcount hits zero.  That can then synchronously
    cancel any outstanding work on the main work item before doing the cleanup.

    Adding a new work item also deals with another problem upstream where it's
    sometimes changing the work func in the put function and requeuing it -
    which has occasionally in the past caused the cleanup to happen
    incorrectly.

    As a bonus, this allows us to get rid of the 'was_async' parameter from a
    bunch of functions.  This indicated whether the put function might not be
    permitted to sleep.

    Fixes: 3d3c950467 ("netfs: Provide readahead and readpage netfs helpers")
    Signed-off-by: David Howells <dhowells@redhat.com>
    Link: https://lore.kernel.org/20250519090707.2848510-4-dhowells@redhat.com
    cc: Paulo Alcantara <pc@manguebit.com>
    cc: Marc Dionne <marc.dionne@auristor.com>
    cc: Steve French <stfrench@microsoft.com>
    cc: linux-cifs@vger.kernel.org
    cc: netfs@lists.linux.dev
    cc: linux-fsdevel@vger.kernel.org
    Signed-off-by: Christian Brauner <brauner@kernel.org>

Signed-off-by: Paulo Alcantara <paalcant@redhat.com>
2025-06-16 21:11:33 -03:00
..
Kconfig
Makefile
compress.h
data.c
decompressor.c
decompressor_deflate.c
decompressor_lzma.c
decompressor_zstd.c
dir.c
erofs_fs.h
fileio.c
fscache.c netfs: Fix the request's work item to not require a ref 2025-06-16 21:11:33 -03:00
inode.c
internal.h
namei.c
super.c
sysfs.c
xattr.c
xattr.h
zdata.c treewide: Introduce kthread_run_worker[_on_cpu]() 2025-05-14 15:47:41 +02:00
zmap.c
zutil.c