Re: [PATCH] block: fix bio_clone_blkg_association() to associate with proper blkcg_gq

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

 



On Wed 01-06-22 10:42:32, Christoph Hellwig wrote:
> On Wed, Jun 01, 2022 at 06:34:05PM +0200, Jan Kara wrote:
> > --- a/block/blk-cgroup.c
> > +++ b/block/blk-cgroup.c
> > @@ -1975,10 +1975,9 @@ EXPORT_SYMBOL_GPL(bio_associate_blkg);
> >  void bio_clone_blkg_association(struct bio *dst, struct bio *src)
> >  {
> >  	if (src->bi_blkg) {
> > +		rcu_read_lock();
> > +		bio_associate_blkg_from_css(dst, bio_blkcg_css(src));
> > +		rcu_read_unlock();
> 
> What do we even need the rcu critical section here?

Good question. I've just blindly copied it from bio_associate_blkg() but
bio_blkcg_css(src) is safe without RCU (we hold object references for all
the dereferences) and bio_associate_blkg_from_css() takes RCU lock in
blkg_tryget_closest() which is the only place where it needs it. So no, we
don't need the RCU lock there. Thanks for noticing. I'll send V2 shortly
with your change and the added tags.

> Otherwise looks good:
> 
> Reviewed-by: Christoph Hellwig <hch@xxxxxx>

Thanks for review!

								Honza
-- 
Jan Kara <jack@xxxxxxxx>
SUSE Labs, CR



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux