From: Jes Sorensen <jes.sorensen@gmail.com>
To: Zhilong Liu <zlliu@suse.com>
Cc: linux-raid@vger.kernel.org
Subject: Re: [mdadm PATCH] Create: move STOP_ARRAY to abort_locked
Date: Thu, 4 May 2017 10:54:48 -0400 [thread overview]
Message-ID: <2c1c277c-2fd2-27a8-e6a5-23b1ced3ec90@gmail.com> (raw)
In-Reply-To: <430f083a-2501-cb74-4ac1-89d1c4620a03@suse.com>
On 05/04/2017 08:20 AM, Zhilong Liu wrote:
> Hi Jes,
>
> apply for review, this is a bug I ever encountered.
Zhilong,
Under what circumstances do you see this?
Thanks,
Jes
>
> On 04/26/2017 03:03 PM, Zhilong Liu wrote:
>> The sysfs entry and devnm would be created once create_mddev()
>> performed successfully, but the creating isn't completed here,
>> move STOP_ARRAY to abort_locked, the purpose is to cleanup the
>> partially created array.
>>
>> Signed-off-by: Zhilong Liu <zlliu@suse.com>
>> ---
>> Create.c | 11 ++++-------
>> 1 file changed, 4 insertions(+), 7 deletions(-)
>>
>> diff --git a/Create.c b/Create.c
>> index 6ca0924..fe0ab7e 100644
>> --- a/Create.c
>> +++ b/Create.c
>> @@ -904,10 +904,8 @@ int Create(struct supertype *st, char *mddev,
>> remove_partitions(fd);
>> if (st->ss->add_to_super(st, &inf->disk,
>> fd, dv->devname,
>> - dv->data_offset)) {
>> - ioctl(mdfd, STOP_ARRAY, NULL);
>> + dv->data_offset))
>> goto abort_locked;
>> - }
>> st->ss->getinfo_super(st, inf, NULL);
>> safe_mode_delay = inf->safe_mode_delay;
>> @@ -1008,7 +1006,6 @@ int Create(struct supertype *st, char *mddev,
>> sysfs_set_safemode(&info, safe_mode_delay);
>> if (err) {
>> pr_err("failed to activate array.\n");
>> - ioctl(mdfd, STOP_ARRAY, NULL);
>> goto abort;
>> }
>> } else if (c->readonly &&
>> @@ -1018,7 +1015,6 @@ int Create(struct supertype *st, char *mddev,
>> "array_state", "readonly") < 0) {
>> pr_err("Failed to start array: %s\n",
>> strerror(errno));
>> - ioctl(mdfd, STOP_ARRAY, NULL);
>> goto abort;
>> }
>> } else {
>> @@ -1030,7 +1026,6 @@ int Create(struct supertype *st, char *mddev,
>> if (info.array.chunk_size &
>> (info.array.chunk_size-1)) {
>> cont_err("Problem may be that chunk size is not
>> a power of 2\n");
>> }
>> - ioctl(mdfd, STOP_ARRAY, NULL);
>> goto abort;
>> }
>> /* if start_ro module parameter is set, array is
>> @@ -1061,7 +1056,9 @@ int Create(struct supertype *st, char *mddev,
>> map_remove(&map, fd2devnm(mdfd));
>> map_unlock(&map);
>> - if (mdfd >= 0)
>> + if (mdfd >= 0) {
>> + ioctl(mdfd, STOP_ARRAY, NULL);
>> close(mdfd);
>> + }
>> return 1;
>> }
>
next prev parent reply other threads:[~2017-05-04 14:54 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-26 7:03 [mdadm PATCH] Create: move STOP_ARRAY to abort_locked Zhilong Liu
2017-05-04 12:20 ` Zhilong Liu
2017-05-04 14:54 ` Jes Sorensen [this message]
2017-05-04 17:42 ` Zhilong
2017-05-05 3:31 ` Liu Zhilong
2017-05-08 1:50 ` Zhilong Liu
2017-05-08 17:54 ` Jes Sorensen
2017-05-11 13:01 ` Zhilong Liu
2017-05-31 10:25 ` Zhilong Liu
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=2c1c277c-2fd2-27a8-e6a5-23b1ced3ec90@gmail.com \
--to=jes.sorensen@gmail.com \
--cc=linux-raid@vger.kernel.org \
--cc=zlliu@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 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).