linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: Dan Williams <dan.j.williams@intel.com>
Cc: linux-raid@vger.kernel.org
Subject: Re: [PATCH] md/raid5: STRIPE_ACTIVE has lock semantics, add barriers
Date: Mon, 7 Nov 2011 12:39:01 +1100	[thread overview]
Message-ID: <20111107123901.252eaab8@notabene.brown> (raw)
In-Reply-To: <20110804003016.30281.26038.stgit@localhost6.localdomain6>

[-- Attachment #1: Type: text/plain, Size: 1631 bytes --]

On Wed, 03 Aug 2011 17:31:23 -0700 Dan Williams <dan.j.williams@intel.com>
wrote:

> All updates that occur under STRIPE_ACTIVE should be globally visible
> when STRIPE_ACTIVE clears.  test_and_set_bit() implies a barrier, but
> clear_bit() does not.
> 
> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
> ---
> 
> This at least was the guarantee we had with sh->lock...
> 
>  drivers/md/raid5.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
> index dbae459..bd95123 100644
> --- a/drivers/md/raid5.c
> +++ b/drivers/md/raid5.c
> @@ -3116,7 +3116,7 @@ static void handle_stripe(struct stripe_head *sh)
>  	struct r5dev *pdev, *qdev;
>  
>  	clear_bit(STRIPE_HANDLE, &sh->state);
> -	if (test_and_set_bit(STRIPE_ACTIVE, &sh->state)) {
> +	if (test_and_set_bit_lock(STRIPE_ACTIVE, &sh->state)) {
>  		/* already being handled, ensure it gets handled
>  		 * again when current action finishes */
>  		set_bit(STRIPE_HANDLE, &sh->state);
> @@ -3377,7 +3377,7 @@ finish:
>  
>  	return_io(s.return_bi);
>  
> -	clear_bit(STRIPE_ACTIVE, &sh->state);
> +	clear_bit_unlock(STRIPE_ACTIVE, &sh->state);
>  }
>  
>  static void raid5_activate_delayed(raid5_conf_t *conf)
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


sorry for missing this before...
I makes perfect sense.  I've applied it and should send it upstream shortly.

Thanks,
NeilBrown


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

      reply	other threads:[~2011-11-07  1:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-04  0:31 [PATCH] md/raid5: STRIPE_ACTIVE has lock semantics, add barriers Dan Williams
2011-11-07  1:39 ` NeilBrown [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=20111107123901.252eaab8@notabene.brown \
    --to=neilb@suse.de \
    --cc=dan.j.williams@intel.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).