[Devel] [PATCH VZ9] fs/fuse/kio: fix unwarranted warning due to flush request race

Kui Liu kui.liu at virtuozzo.com
Tue Oct 28 18:13:27 MSK 2025


the process_ireq_truncate() is dead code which will be removed. I'm in the progress of cleaning up the kio code, and I'll submit patches removing unused code once completed.

________________________________
From: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
Sent: 23 October 2025 11:14
To: Kui Liu <kui.liu at virtuozzo.com>; devel at openvz.org <devel at openvz.org>
Cc: Andrey Zaitsev <azaitsev at virtuozzo.com>
Subject: Re: [Devel] [PATCH VZ9] fs/fuse/kio: fix unwarranted warning due to flush request race

On 10/15/25 19:07, Liu Kui wrote:
> diff --git a/fs/fuse/kio/pcs/pcs_map.c b/fs/fuse/kio/pcs/pcs_map.c
> index 62b083b4947f..8baff296aaa7 100644
> --- a/fs/fuse/kio/pcs/pcs_map.c
> +++ b/fs/fuse/kio/pcs/pcs_map.c
> @@ -1266,23 +1266,14 @@ void pcs_map_complete(struct pcs_map_entry *m, struct pcs_ioc_getmap *omap)
>
>   /* Atomically schedule map resolve and push ireq to wait completion */
>   static void pcs_map_queue_resolve(struct pcs_map_entry * m, struct pcs_int_request *ireq, int direction)
> +__releases(m->lock)
>   {
>        LIST_HEAD(l);
>        int ret;
>
> -     DTRACE("enter m:%p, state:%x, ireq:%p dir:%d \n", m, m->state, ireq, direction);
> -
> -     spin_lock(&m->lock);
> -     /* This should not happen unless aio_dio/fsync vs truncate race */
> -     if (m->state & PCS_MAP_DEAD) {
> -             spin_unlock(&m->lock);
> +     assert_spin_locked(&m->lock);

This will crash when pcs_map_queue_resolve() is called from
process_ireq_truncate().

https://bitbucket.org/virtuozzocore/vzkernel.vzs/src/09103657f3bbe0b06f89337e52190aa4159882a1/fs/fuse/kio/pcs/pcs_map.c#lines-2630



--
Best regards, Pavel Tikhomirov
Senior Software Developer, Virtuozzo.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openvz.org/pipermail/devel/attachments/20251028/f3c2443c/attachment.html>


More information about the Devel mailing list