public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@digeo.com>
To: Andi Kleen <ak@muc.de>
Cc: bzzz@tmi.comex.ru, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] remove BKL from ext2's readdir
Date: Sat, 15 Mar 2003 14:03:18 -0800	[thread overview]
Message-ID: <20030315140318.657b70b7.akpm@digeo.com> (raw)
In-Reply-To: <m3adfwnvls.fsf@averell.firstfloor.org>

Andi Kleen <ak@muc.de> wrote:
>
> Andrew Morton <akpm@digeo.com> writes:
> 
> > foo_readdir()
> > {
> > 	loff_t pos = file->f_pos;
> >
> > 	....
> > 	<code which doesn't touch file->f_pos, but which modifies pos>
> > 	...
> >
> > 	file->f_pos = pos;
> > }
> 
> At least for alpha this will require an rmb_depends() between the read
> and the write. Probably on x86 an rmb() wouldn't hurt neither.
> 
> Otherwise there is no guarantee other CPUs see that intended memory 
> modification order
> 

Won't the atomic operations in down() and up() do that?

It's all a bit moot really.  If two user threads or processes are fighting
over the value of f_pos at the same time in this manner then they're buggy
anyway.  All we need to do here is to ensure that the kernel doesn't do
anything grossly wrong or insecure.


  reply	other threads:[~2003-03-15 21:54 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <m3vfyluedb.fsf@lexa.home.net.suse.lists.linux.kernel>
     [not found] ` <20030315023614.3e28e67b.akpm@digeo.com.suse.lists.linux.kernel>
2003-03-15 21:55   ` [PATCH] remove BKL from ext2's readdir Andi Kleen
2003-03-15 22:03     ` Andrew Morton [this message]
2003-03-15 10:13 Alex Tomas
2003-03-15 10:36 ` Andrew Morton
2003-03-15 11:03   ` Andrew Morton
2003-03-15 16:22     ` Alex Tomas
2003-03-15 20:11       ` Andrew Morton
2003-03-15 20:09         ` Alex Tomas
2003-03-15 20:24           ` Andrew Morton
2003-03-15 20:19             ` Alex Tomas
2003-03-15 16:31   ` Robert Love

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=20030315140318.657b70b7.akpm@digeo.com \
    --to=akpm@digeo.com \
    --cc=ak@muc.de \
    --cc=bzzz@tmi.comex.ru \
    --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