Re: [Resend PATCH 1/2] ceph: introudce a variable to avoid calling refcount_read() twice

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

 



On 2018/7/13 at 下午9:05, Yan, Zheng wrote:

> On Thu, Jul 12, 2018 at 4:47 PM Chengguang Xu <cgxu519@xxxxxxx> wrote:
> >
> > Calling refcount_read() twice may return different value each time,
> > so introduce a variable to avoid it.
> >
> > Signed-off-by: Chengguang Xu <cgxu519@xxxxxxx>
> > ---
> > Sorry, I just wrote wrong email address in previous sending, so resend it.
> > If you have received previous email please ignore it, thanks.
> >
> >  fs/ceph/mds_client.c | 10 ++++++----
> >  1 file changed, 6 insertions(+), 4 deletions(-)
> >
> > diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
> > index df0a3bb0f6a5..2a8d4cc69eb6 100644
> > --- a/fs/ceph/mds_client.c
> > +++ b/fs/ceph/mds_client.c
> > @@ -399,9 +399,10 @@ const char *ceph_session_state_name(int s)
> >
> >  static struct ceph_mds_session *get_session(struct ceph_mds_session *s)
> >  {
> > +
> > +
> >         if (refcount_inc_not_zero(&s->s_ref)) {
> 
> "unsigned int refcnt = refcount_read(&s->s_ref);" should be here

Yeah, indeed. Should I send revised patch?

Thanks,
Chengguang
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



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

  Powered by Linux