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

YONETANI Tomokazu y0n3t4n1 at gmail.com
Tue Feb 15 20:14:46 PST 2011


On Sun, Feb 13, 2011 at 09:08:11PM -0800, Matthew Dillon wrote:
> 
> commit 58c2553a79a1ecfcbfd3ab0cb8e383052af37406
> Author: Matthew Dillon <dillon at 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);
  }





More information about the Commits mailing list