From: Daniel Jacobowitz <dan@debian.org>
To: linux-kernel@vger.kernel.org
Subject: Re: Is this racy?
Date: Mon, 7 Oct 2002 17:37:26 -0400 [thread overview]
Message-ID: <20021007213726.GA6191@nevyn.them.org> (raw)
In-Reply-To: <20021007145152.A4065@mail.harddata.com>
On Mon, Oct 07, 2002 at 02:51:52PM -0600, Michal Jaegermann wrote:
> In fs/proc/array.c (2.4.20-pre9, 2.4.19 and likely many other
> versions) in function 'proc_pid_stat()' there is a code like that:
>
> ......
> read_lock(&tasklist_lock);
> ppid = task->pid ? task->p_opptr->pid : 0;
> read_unlock(&tasklist_lock);
> res = sprintf(buffer,"<long format string>",
> task->pid,
> ......
> ppid,
> ......
>
> So assignment to ppid is locked but other reads from fiels of 'task'
> structure are not guarded that way. Is this ok or if not we do not
> particularly care? Function 'task_state()' in the same file seems
> to be more careful about this.
I think the lock is just so that p_opptr->pid doesn't change while
we're looking at it.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
prev parent reply other threads:[~2002-10-07 21:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-10-07 20:51 Is this racy? Michal Jaegermann
2002-10-07 21:37 ` Daniel Jacobowitz [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20021007213726.GA6191@nevyn.them.org \
--to=dan@debian.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox