Re: [PATCH for-next 01/10] RDMA/rtrs-clt: During add_path change for_new_clt according to path_num

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

 



On Mon, Aug 2, 2021 at 8:40 AM Leon Romanovsky <leon@xxxxxxxxxx> wrote:
>
> On Fri, Jul 30, 2021 at 03:18:23PM +0200, Jack Wang wrote:
> > From: Md Haris Iqbal <haris.iqbal@xxxxxxxxx>
> >
> > When all the paths are removed for a session, the addition of the first
> > path is like a new session for the storage server.
> >
> > Hence, for_new_clt has to be set to 1.
> >
> > Signed-off-by: Md Haris Iqbal <haris.iqbal@xxxxxxxxx>
> > Signed-off-by: Jack Wang <jinpu.wang@xxxxxxxxx>
> > ---
> >  drivers/infiniband/ulp/rtrs/rtrs-clt.c | 9 +++++++++
> >  1 file changed, 9 insertions(+)
> >
> > diff --git a/drivers/infiniband/ulp/rtrs/rtrs-clt.c b/drivers/infiniband/ulp/rtrs/rtrs-clt.c
> > index ece3205531b8..e048bfa12755 100644
> > --- a/drivers/infiniband/ulp/rtrs/rtrs-clt.c
> > +++ b/drivers/infiniband/ulp/rtrs/rtrs-clt.c
> > @@ -3083,6 +3083,15 @@ int rtrs_clt_create_path_from_sysfs(struct rtrs_clt *clt,
> >       if (IS_ERR(sess))
> >               return PTR_ERR(sess);
> >
> > +     if (clt->paths_num == 0) {
>
> Don't you need some protection to read paths_num?
> rcu_read_lock() or mutex_lock?

Good catch. The lock should be added.

Thanks

>
> Thanks



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux