DragonFly BSD
DragonFly commits List (threaded) for 2011-02
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: git: kernel - Make numerous proc accesses use p->p_token instead of proc_token.


From: YONETANI Tomokazu <y0n3t4n1@xxxxxxxxx>
Date: Wed, 16 Feb 2011 13:13:02 +0900

On Sun, Feb 13, 2011 at 09:08:11PM -0800, Matthew Dillon wrote:
> 
> commit 58c2553a79a1ecfcbfd3ab0cb8e383052af37406
> Author: Matthew Dillon <dillon@apollo.backplane.com>
> Date:   Sun Feb 13 20:57:32 2011 -0800
> 
>     kernel - Make numerous proc accesses use p->p_token instead of proc_token.
>
> http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/58c2553a79a1ecfcbfd3ab0cb8e383052af37406

Hi,  with this change pg can get pgrel()'ed twice in leavepgrp(),
is this intended?


  int
  leavepgrp(struct proc *p)
  {
	  struct pgrp *pg = p->p_pgrp;

	  lwkt_gettoken(&p->p_token);
	  pg = p->p_pgrp;
	  if (pg) {
		  pgref(pg);
		  lwkt_gettoken(&pg->pg_token);
		  if (p->p_pgrp == pg) {
			  p->p_pgrp = NULL;
			  LIST_REMOVE(p, p_pglist);
			  pgrel(pg);		<== FIRST
		  }
		  lwkt_reltoken(&pg->pg_token);
		  lwkt_reltoken(&p->p_token);	/* avoid chaining on rel */
		  pgrel(pg);			<== SECOND
	  } else {
		  lwkt_reltoken(&p->p_token);
	  }
	  return (0);
  }



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