All of lore.kernel.org
 help / color / mirror / Atom feed
From: "NeilBrown" <neilb@suse.de>
To: Mario 'BitKoenig' Holbe <Mario.Holbe@TU-Ilmenau.DE>
Cc: linux-raid@vger.kernel.org
Subject: Re: Race condition in write_sb_page? (was: Re: Incorrect in-kernel bitmap on raid10)
Date: Mon, 20 Apr 2009 11:57:54 +1000 (EST)	[thread overview]
Message-ID: <dad4be16a03ccd96d073ecb16b937183.squirrel@neil.brown.name> (raw)
In-Reply-To: <slrngunfh2.90j.Mario.Holbe@darkside.dyn.samba-tng.org>

On Mon, April 20, 2009 10:13 am, Mario 'BitKoenig' Holbe wrote:
> Neil Brown <neilb@suse.de> wrote:
>> On Monday April 20, Mario.Holbe@TU-Ilmenau.DE wrote:
>>> existing bitmapped device. When the full-sync of the new component is
>>> finished, the bitmap on the new component does usually show still lots
>>> of dirty bits (sometimes only a few %, sometimes up to 95%) while the
>> I think that problem is fixed by
>>   commit 355a43e641b948a7b755cb4c2466ec548d5b495f
>> which is in 2.6.29.
>
> .2 probably :)

Actually not - I haven't tagged it for -stable.  It'll be in .30.

I had used "git describe" to see which release it was in, but that
tells me a previous release, but a subsequent one, which make it not
useful for that task.
I should have used 'get name-rev' after  a 'git pull --tags' which
would have told me
  355a43e641b948a7b755cb4c2466ec548d5b495f tags/v2.6.30-rc1~241^2~49
so it is in 30-rc1.


>
> While looking at commit 355a43e641b948a7b755cb4c2466ec548d5b495f I'm not
> sure, if this could raise a race condition: the comment in
> next_active_rdev() states:
> 	 * As devices are only added or removed when raid_disk is < 0 and
> 	 * nr_pending is 0 and In_sync is clear, the entries we return will
> 	 * still be in the same position on the list when we re-enter
> 	 * list_for_each_continue_rcu.
> but commit 355a43e641b948a7b755cb4c2466ec548d5b495f does exactly remove
> the In_sync test. If the comment is true, the removal of the test
> probably opens a window for a race condition.

Thanks for reviewing the code, I really appreciate it.

In this case, I think the code is still fine.
The comment lists a number of conditions that are all true when
something is remove from (or added to) the list.  So we only need
to be sure that one of these is true to be sure the thing wont be removed
from the list.  We previously had 3 of them known to be true.  Now
we only have 2.  But that is still plenty.

Thanks,
NeilBrown


  reply	other threads:[~2009-04-20  1:57 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-18 18:15 Incorrect in-kernel bitmap on raid10 Mario 'BitKoenig' Holbe
2009-04-19  6:24 ` Neil Brown
2009-04-19 22:55   ` Mario 'BitKoenig' Holbe
2009-04-19 23:27     ` Neil Brown
2009-04-20  0:13       ` Race condition in write_sb_page? (was: Re: Incorrect in-kernel bitmap on raid10) Mario 'BitKoenig' Holbe
2009-04-20  1:57         ` NeilBrown [this message]
2009-04-20  8:03           ` Race condition in write_sb_page? Mario 'BitKoenig' Holbe
2009-04-22 18:45   ` Incorrect in-kernel bitmap on raid10 Mario 'BitKoenig' Holbe
2009-04-28 14:05     ` Mario 'BitKoenig' Holbe
2009-05-01  2:11       ` Neil Brown
2009-05-01 17:55         ` Mario 'BitKoenig' Holbe
2009-05-01 21:36           ` NeilBrown
2009-05-02 19:52             ` Mario 'BitKoenig' Holbe
2009-05-02 22:41               ` NeilBrown
2009-05-03 13:22                 ` Mario 'BitKoenig' Holbe
2009-05-07 20:25                   ` Mario 'BitKoenig' Holbe

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=dad4be16a03ccd96d073ecb16b937183.squirrel@neil.brown.name \
    --to=neilb@suse.de \
    --cc=Mario.Holbe@TU-Ilmenau.DE \
    --cc=linux-raid@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.