Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Mar 2014 11:59:50 -0700
From:      John-Mark Gurney <jmg@funkthat.com>
To:        Maksim Yevmenkin <emax@freebsd.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r263690 - head/sys/kern
Message-ID:  <20140324185949.GR32089@funkthat.com>
In-Reply-To: <201403241813.s2OIDfEd024721@svn.freebsd.org>
References:  <201403241813.s2OIDfEd024721@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Maksim Yevmenkin wrote this message on Mon, Mar 24, 2014 at 18:13 +0000:
> Author: emax
> Date: Mon Mar 24 18:13:41 2014
> New Revision: 263690
> URL: http://svnweb.freebsd.org/changeset/base/263690
> 
> Log:
>   change defaule permissions on /dev/devstat. while i'm here remove
>   D_NEEDGIANT flag

I know that the following change is part of the remove D_NEEDGIANT, but
I'm puzzled how this code either worked before, or continues to work..

It looks like pagelist was suppose to be protected by devstat_mutex,
but previously wasn't and that this is fixing that bug, is this
correct?

> @@ -482,13 +481,16 @@ devstat_mmap(struct cdev *dev, vm_ooffse
>  
>  	if (nprot != VM_PROT_READ)
>  		return (-1);
> +	mtx_lock(&devstat_mutex);
>  	TAILQ_FOREACH(spp, &pagelist, list) {
>  		if (offset == 0) {
>  			*paddr = vtophys(spp->stat);
> +			mtx_unlock(&devstat_mutex);
>  			return (0);
>  		}
>  		offset -= PAGE_SIZE;
>  	}
> +	mtx_unlock(&devstat_mutex);
>  	return (-1);
>  }
>  

-- 
  John-Mark Gurney				Voice: +1 415 225 5579

     "All that I will do, has been done, All that I have, has not."



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140324185949.GR32089>