All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: ChenXiaoSong <chenxiaosong@chenxiaosong.com>
Cc: smfrench@gmail.com, linkinjeon@kernel.org, pc@manguebit.org,
	ronniesahlberg@gmail.com, sprasad@microsoft.com, tom@talpey.com,
	bharathsm@microsoft.com, senozhatsky@chromium.org,
	dhowells@redhat.com, metze@samba.org, linux-cifs@vger.kernel.org,
	ChenXiaoSong <chenxiaosong@kylinos.cn>
Subject: Re: [PATCH 2/3] smb/server: cancel async requests when closing connection
Date: Wed, 15 Jul 2026 17:26:59 +0300	[thread overview]
Message-ID: <aleYs2SlElRCfEMO@ashevche-desk.local> (raw)
In-Reply-To: <20260715135513.667260-3-chenxiaosong@chenxiaosong.com>

On Wed, Jul 15, 2026 at 01:55:12PM +0000, ChenXiaoSong wrote:

> An async request may still be waiting when a connection is closed.
> This can stop the connection from closing.
> 
> Cancel active async requests before waiting for them to finish.

...

> +static void ksmbd_conn_cancel_async_requests(struct ksmbd_conn *conn)
> +{
> +	struct ksmbd_work *work;
> +
> +	ksmbd_debug(CONN, "Cancel pending async requests on releasing connection\n");
> +	spin_lock(&conn->request_lock);

> +	list_for_each_entry(work, &conn->async_requests,
> +			    async_request_entry) {

It's perfectly a single line. Note, the strict mode is 80 characters
(inclusive), this line even one less, id est 79 characters.

> +		if (work->state != KSMBD_WORK_ACTIVE)
> +			continue;
> +
> +		ksmbd_debug(CONN, "Cancel async request id %d\n",
> +			    work->async_id);
> +		work->state = KSMBD_WORK_CANCELLED;
> +		if (work->cancel_fn)
> +			work->cancel_fn(work->cancel_argv);
> +	}
> +	spin_unlock(&conn->request_lock);
> +}

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2026-07-15 14:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-15 13:55 [PATCH 0/3] smb/server: fix some bugs in preparation for change notify support ChenXiaoSong
2026-07-15 13:55 ` [PATCH 1/3] smb/server: fix signing when a response uses more than one iov ChenXiaoSong
2026-07-15 14:25   ` Andy Shevchenko
2026-07-15 15:04     ` ChenXiaoSong
2026-07-15 15:18       ` ChenXiaoSong
2026-07-15 13:55 ` [PATCH 2/3] smb/server: cancel async requests when closing connection ChenXiaoSong
2026-07-15 14:26   ` Andy Shevchenko [this message]
2026-07-15 13:55 ` [PATCH 3/3] smb/server: stop new async work " ChenXiaoSong
2026-07-15 15:22 ` [PATCH 0/3] smb/server: fix some bugs in preparation for change notify support ChenXiaoSong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aleYs2SlElRCfEMO@ashevche-desk.local \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=bharathsm@microsoft.com \
    --cc=chenxiaosong@chenxiaosong.com \
    --cc=chenxiaosong@kylinos.cn \
    --cc=dhowells@redhat.com \
    --cc=linkinjeon@kernel.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=metze@samba.org \
    --cc=pc@manguebit.org \
    --cc=ronniesahlberg@gmail.com \
    --cc=senozhatsky@chromium.org \
    --cc=smfrench@gmail.com \
    --cc=sprasad@microsoft.com \
    --cc=tom@talpey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.