Re: [PATCH 4/5] ceph: move mdsc->mutex into __do_request()

Xiubo Li <[email protected]> Wed, 15 Jul 2026 11:02:23 +0800
Newsgroups org.kernel.vger.ceph-devel,org.kernel.vger.linux-kernel
Message-ID <CAOJNxRKvcoQVBbF4ZeVg9aO3D=DzcG-4RYf06H-tSBVOyxJLnQ@mail.gmail.com>
On Wed, 15 Jul 2026 at 02:52, Viacheslav Dubeyko <[email protected]> wrote:
>
> On Mon, 2026-07-13 at 17:46 +0800, Xiubo Li via B4 Relay wrote:
> > From: Xiubo Li <[email protected]>
> >
> > __do_request() now acquires mdsc->mutex on entry and unlocks at
> > every exit point, so callers no longer need to hold it.  As a
> > result kick_requests() is now completely free of mdsc->mutex:
> > xa_for_each() is internally locked, list_del_init() is guarded by
> > wait_list_lock, and __do_request() manages its own serialization.
> >
> > Remove the no-longer-needed mutex_lock/unlock around __do_request()
> > in ceph_mdsc_submit_request() and handle_forward().  The do_request()

[......]

> > @@ -7088,9 +7095,7 @@ static void mds_peer_reset(struct
> > ceph_connection *con)
> >
> >               wake_up_all(&mdsc->session_close_wq);
> >
> > -             mutex_lock(&mdsc->mutex);
> >               kick_requests(mdsc, s->s_mds);
> > -             mutex_unlock(&mdsc->mutex);
> >
> >               ceph_put_mds_session(s);
> >               break;
>
>
> If I am not wrong, we still have comment [1]:
>
> /*
>  * called under mdsc->mutex
>  */
> static void __wake_requests(struct ceph_mds_client *mdsc,
>                             struct list_head *head)
>

Good catch. I will remove that comment. Thanks Slava.

Xiubo Li

> Thanks,
> Slava.
>
> [1]
> https://elixir.bootlin.com/linux/v7.2-rc3/source/fs/ceph/mds_client.c#L3793