All of lore.kernel.org
 help / color / mirror / Atom feed
From: jes.sorensen@gmail.com
To: Gioh Kim <gi-oh.kim@profitbricks.com>
Cc: neilb@suse.com, linux-raid@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Jack Wang <jinpu.wang@profitbricks.com>
Subject: Re: [PATCH 1/2] super1: ignore failfast flag for setting device role
Date: Fri, 17 Mar 2017 16:20:58 -0400	[thread overview]
Message-ID: <wrfjwpbnirit.fsf@gmail.com> (raw)
In-Reply-To: <1489769222-31855-2-git-send-email-gi-oh.kim@profitbricks.com> (Gioh Kim's message of "Fri, 17 Mar 2017 17:47:01 +0100")

Gioh Kim <gi-oh.kim@profitbricks.com> writes:
> There is corner case for setting device role,
> if new device has failfast flag.
> The failfast flag should be ignored.
>
> Signed-off-by: Gioh Kim <gi-oh.kim@profitbricks.com>
> Signed-off-by: Jack Wang <jinpu.wang@profitbricks.com>
> ---
>  super1.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/super1.c b/super1.c
> index 882cd61..1da33ef 100644
> --- a/super1.c
> +++ b/super1.c
> @@ -1491,6 +1491,7 @@ static int add_to_super1(struct supertype *st, mdu_disk_info_t *dk,
>  	struct devinfo *di, **dip;
>  	bitmap_super_t *bms = (bitmap_super_t*)(((char*)sb) + MAX_SB_SIZE);
>  	int rv, lockid;
> +	int dk_state;
>  
>  	if (bms->version == BITMAP_MAJOR_CLUSTERED && dlm_funs_ready()) {
>  		rv = cluster_get_dlmlock(&lockid);
> @@ -1501,11 +1502,12 @@ static int add_to_super1(struct supertype *st, mdu_disk_info_t *dk,
>  		}
>  	}
>  
> -	if ((dk->state & 6) == 6) /* active, sync */
> +	dk_state &= ~(1<<MD_DISK_FAILFAST);
> +	if ((dk_state & 6) == 6) /* active, sync */
>  		*rp = __cpu_to_le16(dk->raid_disk);

This does not look right - you haven't assigned a value to dk_state, but
then start masking bits out of it.

Cheers,
Jes

  reply	other threads:[~2017-03-17 20:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-17 16:47 [PATCH 0/2] mdadm: setting device role of raid1 disk with failfast Gioh Kim
2017-03-17 16:47 ` [PATCH 1/2] super1: ignore failfast flag for setting device role Gioh Kim
2017-03-17 20:20   ` jes.sorensen [this message]
2017-03-17 16:47 ` [PATCH 2/2] super1: check and output faulty dev role Gioh Kim

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=wrfjwpbnirit.fsf@gmail.com \
    --to=jes.sorensen@gmail.com \
    --cc=gi-oh.kim@profitbricks.com \
    --cc=jinpu.wang@profitbricks.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=neilb@suse.com \
    /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.