Re: [PATCH] ceph: fix NULL pointer dereference for req->r_session

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Oct 27, 2022 at 11:12 AM <xiubli@xxxxxxxxxx> wrote:
>
> From: Xiubo Li <xiubli@xxxxxxxxxx>
>
> The request's r_session maybe changed when it was forwarded or
> resent.
>
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Xiubo Li <xiubli@xxxxxxxxxx>
> ---
>  fs/ceph/caps.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
> index 894adfb4a092..d34ac716d7fe 100644
> --- a/fs/ceph/caps.c
> +++ b/fs/ceph/caps.c
> @@ -2341,6 +2341,7 @@ static int flush_mdlog_and_wait_inode_unsafe_requests(struct inode *inode)
>                         goto out;
>                 }
>
> +               mutex_lock(&mdsc->mutex);

Hi Xiubo,

A few lines above, there is the following comment:

        /*
         * The mdsc->max_sessions is unlikely to be changed
         * mostly, here we will retry it by reallocating the
         * sessions array memory to get rid of the mdsc->mutex
         * lock.
         */

Does retry label and gotos still make sense if mdsc->mutex is
introduced?  Would it make sense to move it up and get rid of
retry code?

Thanks,

                Ilya



[Index of Archives]     [CEPH Users]     [Ceph Large]     [Ceph Dev]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux