lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100421151115.GB3275@redhat.com>
Date:	Wed, 21 Apr 2010 11:11:15 -0400
From:	Vivek Goyal <vgoyal@...hat.com>
To:	Jens Axboe <jens.axboe@...cle.com>
Cc:	linux kernel mailing list <linux-kernel@...r.kernel.org>,
	Divyesh Shah <dpshah@...gle.com>,
	Nauman Rafique <nauman@...gle.com>,
	Gui Jianfeng <guijianfeng@...fujitsu.com>
Subject: Re: [PATCH] blkio: Fix a crash during rq stats update

On Wed, Apr 21, 2010 at 04:55:14PM +0200, Jens Axboe wrote:
> On Wed, Apr 21 2010, Vivek Goyal wrote:
> > @@ -1001,6 +1002,10 @@ static struct cfq_group *cfq_get_cfqg(struct cfq_data *cfqd, int create)
> >  	return cfqg;
> >  }
> >  
> > +static inline void cfq_get_cfqg_ref(struct cfq_group *cfqg) {
> > +	atomic_inc(&cfqg->ref);
> > +}
> 
> Would be nicer as
> 
> static inline void cfq_ref_get_cfqg(struct cfq_group *cfqg)
> {

Chagne of name, will do.

> 	atomic_inc(&cfqg->ref);
>         return cfqg;
> }

So you want to return cfqg pointer here instead of return type being void?

> 
> ...
> 
> static inline void cfq_ref_get_cfqg(struct cfq_group *cfqg)
> {
>         return NULL;
> }

Will fix it.

Ok, so in case of CFQ_GROUP_IOSCHED, return a poitner to cfqg upon getting
the reference, otherwise NULL. Will fix it.

Thanks
Vivek
> 
> ...
> 
> > @@ -3560,6 +3570,9 @@ new_queue:
> >  
> >  	rq->elevator_private = cic;
> >  	rq->elevator_private2 = cfqq;
> > +	rq->elevator_private3 = cfqq->cfqg;
> > +	/* rq reference on cfqg */
> > +	cfq_get_cfqg_ref(RQ_CFQG(rq));
> >  	return 0;
> 
> rq->elevator_private3 = cfq_ref_get_cfqg(...);
> 
> -- 
> Jens Axboe
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ