linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: gary <gary.mdjiang@gmail.com>
To: Goldwyn Rodrigues <rgoldwyn@suse.de>, Guoqing Jiang <GQJiang@suse.com>
Cc: neilb@suse.de, linux-raid@vger.kernel.org
Subject: Re: [PATCH 2/4] md-cluster: remove capabilities
Date: Wed, 15 Apr 2015 10:24:02 +0800	[thread overview]
Message-ID: <552DCBC2.5040209@gmail.com> (raw)
In-Reply-To: <552CF96A.7000306@suse.de>

Hi Goldwyn,
>>> diff --git a/drivers/md/md.c b/drivers/md/md.c
>>> index bc11551..0c65e51 100644
>>> --- a/drivers/md/md.c
>>> +++ b/drivers/md/md.c
>>> @@ -2291,11 +2291,12 @@ static void export_rdev(struct md_rdev * rdev)
>>>       kobject_put(&rdev->kobj);
>>>   }
>>>
>>> -static void kick_rdev_from_array(struct md_rdev * rdev)
>>> +void md_kick_rdev_from_array(struct md_rdev * rdev)
>>>   {
>>>       unbind_rdev_from_array(rdev);
>>>       export_rdev(rdev);
>>>   }
>>> +EXPORT_SYMBOL_GPL(md_kick_rdev_from_array);
>>>
>>>   static void export_array(struct mddev *mddev)
>>>   {
>>> @@ -2306,7 +2307,7 @@ static void export_array(struct mddev *mddev)
>>>               MD_BUG();
>>>               continue;
>>>           }
>>> -        kick_rdev_from_array(rdev);
>>> +        md_kick_rdev_from_array(rdev);
>>>       }
>>>       if (!list_empty(&mddev->disks))
>>>           MD_BUG();
>>> @@ -2750,9 +2751,11 @@ state_store(struct md_rdev *rdev, const char 
>>> *buf, size_t len)
>>>               err = -EBUSY;
>>>           else {
>>>               struct mddev *mddev = rdev->mddev;
>>> -            if (mddev_is_clustered(mddev))
>>> +            if (mddev_is_clustered(mddev)) {
>>> md_cluster_ops->metadata_update_start(mddev);
>>> -            kick_rdev_from_array(rdev);
>>> +                md_cluster_ops->remove_disk(mddev, rdev);
>>> +            }
>>> +            md_kick_rdev_from_array(rdev);
>>>
>> For md-cluster, seems it is possible that md_kick_rdev_from_array could
>> be called twice,
>> is this what you want? Thanks.
>
>
> No, it would be called only once. There are two types of nodes in this 
> case: one is  sender and other received. The sender calls 
> md_kick_rdev_from_array() in the regular flow of 
> state_store/hot_remove_disk() while the receiver calls 
> md_kick_rdev_from_array() in the process_remove_disk().
>
Thanks for explanation, both sender node and receiver node need to kick
the disk from array. I misunderstood it, :(.

Regards,
Guoqing

      reply	other threads:[~2015-04-15  2:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-08 19:22 [PATCH 2/4] md-cluster: remove capabilities Goldwyn Rodrigues
2015-04-08 23:24 ` NeilBrown
2015-04-13  2:27 ` Guoqing Jiang
2015-04-14 11:26   ` Goldwyn Rodrigues
2015-04-15  2:24     ` gary [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=552DCBC2.5040209@gmail.com \
    --to=gary.mdjiang@gmail.com \
    --cc=GQJiang@suse.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=neilb@suse.de \
    --cc=rgoldwyn@suse.de \
    /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).