From: NeilBrown <neilb@suse.de>
To: "Dorau, Lukasz" <lukasz.dorau@intel.com>
Cc: "linux-raid@vger.kernel.org" <linux-raid@vger.kernel.org>,
"Williams, Dan J" <dan.j.williams@intel.com>,
"Ciechanowski, Ed" <ed.ciechanowski@intel.com>,
"Patelczyk, Maciej" <maciej.patelczyk@intel.com>,
"Danecki, Jacek" <jacek.danecki@intel.com>,
"Kwolek, Adam" <adam.kwolek@intel.com>
Subject: Re: [PATCH 07/14] FIX: Extend size of raid0 array
Date: Fri, 20 Apr 2012 07:23:49 +1000 [thread overview]
Message-ID: <20120420072349.7636d58f@notabene.brown> (raw)
In-Reply-To: <D9FFE20C522965449E182ACE73889AEB185DF96A@IRSMSX101.ger.corp.intel.com>
[-- Attachment #1: Type: text/plain, Size: 3679 bytes --]
On Thu, 19 Apr 2012 15:09:45 +0000 "Dorau, Lukasz" <lukasz.dorau@intel.com>
wrote:
> On Tuesday, April 17, 2012 4:53 AM NeilBrown wrote:
> >
> > On Fri, 13 Apr 2012 16:52:01 +0200 Adam Kwolek <adam.kwolek@intel.com>
> > wrote:
> >
> > > For raid0, takeover operation is required for size change.
> > > Add takeover to degraded raid4 before size change and back to raid0 after.
> > > Array information has to be read again from md after takeover.
> > >
> > > Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
> > > ---
> > > Grow.c | 35 +++++++++++++++++++++++++++++++++++
> > > 1 files changed, 35 insertions(+), 0 deletions(-)
> > >
> > > diff --git a/Grow.c b/Grow.c
> > > index 8c7bafc..e8f6554 100644
> > > --- a/Grow.c
> > > +++ b/Grow.c
> > > @@ -1626,6 +1626,7 @@ int Grow_reshape(char *devname, int fd, int
> > quiet, char *backup_file,
> > > long long orig_size = get_component_size(fd)/2;
> > > long long min_csize;
> > > struct mdinfo *mdi;
> > > + int raid0_takeover = 0;
> > >
> > > if (orig_size == 0)
> > > orig_size = array.size;
> > > @@ -1674,6 +1675,28 @@ int Grow_reshape(char *devname, int fd, int
> > quiet, char *backup_file,
> > > "2TB per device\n");
> > > size = min_csize;
> > > }
> > > + if (st->ss->external) {
> > > + if (sra->array.level == 0) {
> > > + rv = sysfs_set_str(sra, NULL, "level",
> > > + "raid5");
> > > + if (!rv) {
> > > + raid0_takeover = 1;
> > > + /* get array parametes after takeover
> > > + * to chane one parameter at time
> > only
> > > + */
> > > + rv = ioctl(fd, GET_ARRAY_INFO,
> > &array);
> > > + }
> > > + }
> > > + /* make sure mdmon is
> > > + * aware of the new level */
> > > + if (!mdmon_running(st->container_dev))
> > > + start_mdmon(st->container_dev);
> > > + ping_monitor(container);
> > > + if (mdmon_running(st->container_dev) &&
> > > + st->update_tail == NULL)
> > > + st->update_tail = &st->updates;
> > > + }
> > > +
> > > array.size = size;
> > > if (array.size != size) {
> > > /* got truncated to 32bit, write to
> > > @@ -1686,12 +1709,24 @@ int Grow_reshape(char *devname, int fd, int
> > quiet, char *backup_file,
> > > rv = -1;
> > > } else {
> > > rv = ioctl(fd, SET_ARRAY_INFO, &array);
> > > +
> > > /* manage array size when it is managed externally
> > > */
> > > if ((rv == 0) && st->ss->external)
> > > rv = set_array_size(st, sra, sra->text_version);
> > > }
> > >
> > > + if (raid0_takeover) {
> > > + /* do not recync non-existing parity,
> > > + * we will drop it anyway
> > > + */
> > > + sysfs_set_str(sra, NULL, "sync_action", "idle");
> >
> > This is probably ineffective. If the array thinks it needs to resync, then
> > just setting it to 'idle' will only stop in temporarily. It will immediately
> > start syncing again.
> >
> > However given that it is a RAID5 array which is degraded, it shouldn't try to
> > resync at all.
> >
> > So: does it still work if you remove this line? If so, could you send a
> > patch to remove it?
> > If not - we should work out why.
> >
>
> It doesn't work without this line.
> The N-disks raid0 changes to degraded (N+1)-disks raid5 (N of N+1 disks)
> in /proc/mdstat after size extension, however the metadata on all disks is correct.
>
In that case I suspect that fact that it works with the line is racy and it
could sometimes fail. Setting "sync_action" to "frozen" would be safer.
Can you confirm that also works? I'd feel more comfortable about that.
NeilBrown
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
next prev parent reply other threads:[~2012-04-19 21:23 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-13 14:51 [PATCH 00/14] imsm: volume expand Adam Kwolek
2012-04-13 14:51 ` [PATCH 01/14] imsm: FIX: Update function imsm_num_data_members() for Raid1/10 Adam Kwolek
2012-04-13 14:51 ` [PATCH 02/14] imsm: FIX: Add volume size expand support to imsm_analyze_change() Adam Kwolek
2012-04-13 14:51 ` [PATCH 03/14] imsm: Add new metadata update for volume size expansion Adam Kwolek
2012-04-13 14:51 ` [PATCH 04/14] imsm: Execute size change for external metatdata Adam Kwolek
2012-04-13 14:51 ` [PATCH 05/14] FIX: Support metadata changes rollback Adam Kwolek
2012-04-13 14:52 ` [PATCH 06/14] imsm: " Adam Kwolek
2012-04-13 14:52 ` [PATCH 07/14] FIX: Extend size of raid0 array Adam Kwolek
2012-04-13 14:52 ` [PATCH 08/14] FIX: Respect metadata size limitations Adam Kwolek
2012-04-13 14:52 ` [PATCH 09/14] FIX: Detect error and rollback metadata Adam Kwolek
2012-04-13 14:52 ` [PATCH 10/14] imsm: Add function imsm_get_free_size() Adam Kwolek
2012-04-13 14:52 ` [PATCH 11/14] imsm: Support setting max size for size change operation Adam Kwolek
2012-04-13 14:52 ` [PATCH 12/14] imsm: FIX: Component size alignment check Adam Kwolek
2012-04-13 14:52 ` [PATCH 13/14] FIX: Size change is possible as standalone change only Adam Kwolek
2012-04-13 14:52 ` [PATCH 14/14] FIX: Assembled second array is in read only state during reshape Adam Kwolek
2012-04-17 2:52 ` [PATCH 07/14] FIX: Extend size of raid0 array NeilBrown
2012-04-19 15:09 ` Dorau, Lukasz
2012-04-19 21:23 ` NeilBrown [this message]
2012-04-20 8:48 ` Dorau, Lukasz
2012-04-17 2:56 ` [PATCH 00/14] imsm: volume expand NeilBrown
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=20120420072349.7636d58f@notabene.brown \
--to=neilb@suse.de \
--cc=adam.kwolek@intel.com \
--cc=dan.j.williams@intel.com \
--cc=ed.ciechanowski@intel.com \
--cc=jacek.danecki@intel.com \
--cc=linux-raid@vger.kernel.org \
--cc=lukasz.dorau@intel.com \
--cc=maciej.patelczyk@intel.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 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).