Re: [PATCH 1/8] blkcg: kill blkio_list and replace blkio_list_lock with a mutex

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

 



On Fri, Apr 13, 2012 at 09:32:26AM -0400, Vivek Goyal wrote:
> On Thu, Apr 12, 2012 at 04:29:33PM -0700, Tejun Heo wrote:
> 
> Hi Tejun,
> 
> > @@ -732,20 +732,21 @@ void blkio_policy_register(struct blkio_policy_type *blkiop)
> >  {
> >  	struct request_queue *q;
> >  
> > +	mutex_lock(&blkcg_pol_mutex);
> > +
> >  	blkcg_bypass_start();
> > -	spin_lock(&blkio_list_lock);
> >  
> >  	BUG_ON(blkio_policy[blkiop->plid]);
> 
> A minor nit. It might be a good idea to check that blkiop->plid is not
> greater than BLKIO_NR_POLICIES for both registration and unresitration
> functions to avoid touching memory beyond blkio_policy[] array.

I'm making ->plid to be dynamically allocated on registration anyway,
so I don't think it really matters.  The updated unregistration
function does BUG_ON(blkio_policy[pol->plid] != pol) which should
catch stray plid.

Thanks.

-- 
tejun
_______________________________________________
Containers mailing list
Containers@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linuxfoundation.org/mailman/listinfo/containers


[Index of Archives]     [Cgroups]     [Netdev]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux