* [PATCH] Grow: goto release if Manage_subdevs failed
@ 2016-03-22 9:03 Guoqing Jiang
2016-03-22 17:54 ` Jes Sorensen
0 siblings, 1 reply; 3+ messages in thread
From: Guoqing Jiang @ 2016-03-22 9:03 UTC (permalink / raw)
To: Jes.Sorensen; +Cc: linux-raid, Guoqing Jiang
If failure happened when add disk to array
by grow mode, need to goto release instead
of continue the reshape.
Signed-off-by: Guoqing Jiang <gqjiang@suse.com>
---
Grow.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/Grow.c b/Grow.c
index cf2750a..1767a1e 100755
--- a/Grow.c
+++ b/Grow.c
@@ -3003,8 +3003,9 @@ static int reshape_array(char *container, int fd, char *devname,
* level and frozen, we can safely add them.
*/
if (devlist)
- Manage_subdevs(devname, fd, devlist, verbose,
- 0,NULL, 0);
+ if (Manage_subdevs(devname, fd, devlist, verbose,
+ 0,NULL, 0))
+ goto release;
if (reshape.backup_blocks == 0 && data_offset != INVALID_SECTORS)
reshape.backup_blocks = reshape.before.data_disks * info->array.chunk_size/512;
--
2.6.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Grow: goto release if Manage_subdevs failed
2016-03-22 9:03 [PATCH] Grow: goto release if Manage_subdevs failed Guoqing Jiang
@ 2016-03-22 17:54 ` Jes Sorensen
2016-03-23 1:13 ` Guoqing Jiang
0 siblings, 1 reply; 3+ messages in thread
From: Jes Sorensen @ 2016-03-22 17:54 UTC (permalink / raw)
To: Guoqing Jiang; +Cc: linux-raid
Guoqing Jiang <gqjiang@suse.com> writes:
> If failure happened when add disk to array
> by grow mode, need to goto release instead
> of continue the reshape.
>
> Signed-off-by: Guoqing Jiang <gqjiang@suse.com>
> ---
> Grow.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/Grow.c b/Grow.c
> index cf2750a..1767a1e 100755
> --- a/Grow.c
> +++ b/Grow.c
> @@ -3003,8 +3003,9 @@ static int reshape_array(char *container, int fd, char *devname,
> * level and frozen, we can safely add them.
> */
> if (devlist)
> - Manage_subdevs(devname, fd, devlist, verbose,
> - 0,NULL, 0);
> + if (Manage_subdevs(devname, fd, devlist, verbose,
> + 0,NULL, 0))
> + goto release;
>
> if (reshape.backup_blocks == 0 && data_offset != INVALID_SECTORS)
> reshape.backup_blocks = reshape.before.data_disks * info->array.chunk_size/512;
Applied with minor mod to add brackets to the outer if() case - I hope
you are OK with this.
Cheers,
Jes
From 31dbeda730ab1c25040f2e9b5bc49008b8519adf Mon Sep 17 00:00:00 2001
From: Guoqing Jiang <gqjiang@suse.com>
Date: Tue, 22 Mar 2016 17:03:44 +0800
Subject: [PATCH] Grow: goto release if Manage_subdevs failed
If failure happened when add disk to array
by grow mode, need to goto release instead
of continue the reshape.
Signed-off-by: Guoqing Jiang <gqjiang@suse.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
Grow.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/Grow.c b/Grow.c
index 3204135..5953db2 100755
--- a/Grow.c
+++ b/Grow.c
@@ -3009,9 +3009,11 @@ static int reshape_array(char *container, int fd, char *devname,
* array. Now that the array has been changed to the right
* level and frozen, we can safely add them.
*/
- if (devlist)
- Manage_subdevs(devname, fd, devlist, verbose,
- 0,NULL, 0);
+ if (devlist) {
+ if (Manage_subdevs(devname, fd, devlist, verbose,
+ 0, NULL, 0))
+ goto release;
+ }
if (reshape.backup_blocks == 0 && data_offset != INVALID_SECTORS)
reshape.backup_blocks = reshape.before.data_disks * info->array.chunk_size/512;
--
2.5.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Grow: goto release if Manage_subdevs failed
2016-03-22 17:54 ` Jes Sorensen
@ 2016-03-23 1:13 ` Guoqing Jiang
0 siblings, 0 replies; 3+ messages in thread
From: Guoqing Jiang @ 2016-03-23 1:13 UTC (permalink / raw)
To: Jes Sorensen; +Cc: linux-raid
On 03/23/2016 01:54 AM, Jes Sorensen wrote:
> Guoqing Jiang <gqjiang@suse.com> writes:
>> If failure happened when add disk to array
>> by grow mode, need to goto release instead
>> of continue the reshape.
>>
>> Signed-off-by: Guoqing Jiang <gqjiang@suse.com>
>> ---
>> Grow.c | 5 +++--
>> 1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/Grow.c b/Grow.c
>> index cf2750a..1767a1e 100755
>> --- a/Grow.c
>> +++ b/Grow.c
>> @@ -3003,8 +3003,9 @@ static int reshape_array(char *container, int fd, char *devname,
>> * level and frozen, we can safely add them.
>> */
>> if (devlist)
>> - Manage_subdevs(devname, fd, devlist, verbose,
>> - 0,NULL, 0);
>> + if (Manage_subdevs(devname, fd, devlist, verbose,
>> + 0,NULL, 0))
>> + goto release;
>>
>> if (reshape.backup_blocks == 0 && data_offset != INVALID_SECTORS)
>> reshape.backup_blocks = reshape.before.data_disks * info->array.chunk_size/512;
> Applied with minor mod to add brackets to the outer if() case - I hope
> you are OK with this.
Thanks, I am fine with it :).
Regards,
Guoqing
>
> Cheers,
> Jes
>
> From 31dbeda730ab1c25040f2e9b5bc49008b8519adf Mon Sep 17 00:00:00 2001
> From: Guoqing Jiang <gqjiang@suse.com>
> Date: Tue, 22 Mar 2016 17:03:44 +0800
> Subject: [PATCH] Grow: goto release if Manage_subdevs failed
>
> If failure happened when add disk to array
> by grow mode, need to goto release instead
> of continue the reshape.
>
> Signed-off-by: Guoqing Jiang <gqjiang@suse.com>
> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
> ---
> Grow.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/Grow.c b/Grow.c
> index 3204135..5953db2 100755
> --- a/Grow.c
> +++ b/Grow.c
> @@ -3009,9 +3009,11 @@ static int reshape_array(char *container, int fd, char *devname,
> * array. Now that the array has been changed to the right
> * level and frozen, we can safely add them.
> */
> - if (devlist)
> - Manage_subdevs(devname, fd, devlist, verbose,
> - 0,NULL, 0);
> + if (devlist) {
> + if (Manage_subdevs(devname, fd, devlist, verbose,
> + 0, NULL, 0))
> + goto release;
> + }
>
> if (reshape.backup_blocks == 0 && data_offset != INVALID_SECTORS)
> reshape.backup_blocks = reshape.before.data_disks * info->array.chunk_size/512;
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-03-23 1:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-22 9:03 [PATCH] Grow: goto release if Manage_subdevs failed Guoqing Jiang
2016-03-22 17:54 ` Jes Sorensen
2016-03-23 1:13 ` Guoqing Jiang
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).