From: NeilBrown <neilb@suse.de>
To: Adam Kwolek <adam.kwolek@intel.com>
Cc: linux-raid@vger.kernel.org, ed.ciechanowski@intel.com,
marcin.labun@intel.com, dan.j.williams@intel.com
Subject: Re: [PATCH 1/3] FIX: Do not allow for multiple reshape_array() execution during reshape_container() call
Date: Wed, 14 Dec 2011 19:08:57 +1100 [thread overview]
Message-ID: <20111214190857.7ab891dd@notabene.brown> (raw)
In-Reply-To: <20111213101210.15703.14918.stgit@gklab-128-013.igk.intel.com>
[-- Attachment #1: Type: text/plain, Size: 2039 bytes --]
On Tue, 13 Dec 2011 11:12:10 +0100 Adam Kwolek <adam.kwolek@intel.com> wrote:
> It can happen during reshape restart that reshape_array() can exit without
> error (e.g. Grow.c:1915) and reshape is not moved to next array.
> reshape_array() is called again for the same device.
> Do not allow for such execution and check if last reshaped array is not
> the current one.
> This patch can be treat not as solution, but it allows for such errors
> detection.
>
> Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Hi Adam.
I'm afraid I understand the problem that requires this patch.
Could you please outline how it can happen that "reshape_array() can exit
without error (e.g. Grow.c:1915) and reshape is not moved to next array."
Also the comment in the code seems to be incomplete. Could you complete it
please?
Thanks.
The other 2 patches in the series are fine.
Thanks,
NeilBrown
> ---
>
> Grow.c | 12 ++++++++++++
> 1 files changed, 12 insertions(+), 0 deletions(-)
>
> diff --git a/Grow.c b/Grow.c
> index 184a973..1828f83 100644
> --- a/Grow.c
> +++ b/Grow.c
> @@ -2462,6 +2462,7 @@ int reshape_container(char *container, char *devname,
> {
> struct mdinfo *cc = NULL;
> int rv = restart;
> + int last_devnum = -1;
>
> /* component_size is not meaningful for a container,
> * so pass '-1' meaning 'no change'
> @@ -2546,6 +2547,17 @@ int reshape_container(char *container, char *devname,
> if (!adev)
> adev = content->text_version;
>
> + if (last_devnum == mdstat->devnum) {
> + /* do not allow for reentry reshape_array()
> + * for the same device. It can happen when resahpe_array
This one. Should there be more to this sentence?
NB
> + */
> + printf(Name ": Multiple reshape execution detected for "
> + "device %s.", adev);
> + close(fd);
> + break;
> + }
> + last_devnum = mdstat->devnum;
> +
> sysfs_init(content, fd, mdstat->devnum);
>
> rv = reshape_array(container, fd, adev, st,
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
next prev parent reply other threads:[~2011-12-14 8:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-13 10:12 [PATCH 1/3] FIX: Do not allow for multiple reshape_array() execution during reshape_container() call Adam Kwolek
2011-12-13 10:12 ` [PATCH 2/3] FIX: Add error message in container_reshape() Adam Kwolek
2011-12-13 10:12 ` [PATCH 3/3] imsm: FIX: return correct status from load_imsm_migr_rec() Adam Kwolek
2011-12-14 8:08 ` NeilBrown [this message]
2011-12-14 8:19 ` [PATCH 1/3] FIX: Do not allow for multiple reshape_array() execution during reshape_container() call Kwolek, Adam
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=20111214190857.7ab891dd@notabene.brown \
--to=neilb@suse.de \
--cc=adam.kwolek@intel.com \
--cc=dan.j.williams@intel.com \
--cc=ed.ciechanowski@intel.com \
--cc=linux-raid@vger.kernel.org \
--cc=marcin.labun@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