From: Jes Sorensen <jes.sorensen@gmail.com>
To: Mariusz Tkaczyk <mariusz.tkaczyk@intel.com>, linux-raid@vger.kernel.org
Subject: Re: [PATCH v2] Monitor: containers don't have the same sysfs properties as arrays
Date: Wed, 16 Aug 2017 06:34:44 -0400 [thread overview]
Message-ID: <544652f0-97d4-d228-7832-cd0268727433@gmail.com> (raw)
In-Reply-To: <1501161728-580-1-git-send-email-mariusz.tkaczyk@intel.com>
On 07/27/2017 09:22 AM, Mariusz Tkaczyk wrote:
> GET_MISMATCH option doesn't exist for containers so sysfs_read fails if
> this information is requested. Set options according to the device using
> information from /proc/mdstat.
>
> Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@intel.com>
> ---
> Monitor.c | 45 +++++++++++++++++++++++++++------------------
> 1 file changed, 27 insertions(+), 18 deletions(-)
Hi Mariusz,
Sorry for the late response, I am just back from PTO.
I know you will hate me for this, but I have one more nit:
> diff --git a/Monitor.c b/Monitor.c
> index 48c451c..de470bd 100644
> --- a/Monitor.c
> +++ b/Monitor.c
> @@ -465,6 +465,8 @@ static int check_array(struct state *st, struct mdstat_ent *mdstat,
> int last_disk;
> int new_array = 0;
> int retval;
> + int is_container;
> + unsigned long array_only_flags = 0;
>
> if (test)
> alert("TestMessage", dev, NULL, ainfo);
[snip]
> + if (!mse) {
> + /* duplicated array in statelist
> + * or re-created after reading mdstat
> + */
> + st->err++;
> + goto out;
> + }
> +
> + is_container = mse->level == NULL;
I really find this last line super obfuscating - I had to go back and
read it again to realize it wasn't just trying to set is_container and
mse->level both to NULL.
Would you mind using an if statement there instead?
Thanks,
Jes
next prev parent reply other threads:[~2017-08-16 10:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-27 13:22 [PATCH v2] Monitor: containers don't have the same sysfs properties as arrays Mariusz Tkaczyk
2017-08-16 10:34 ` Jes Sorensen [this message]
2017-08-16 12:22 ` [PATCH v3] " Mariusz Tkaczyk
2017-08-16 12:26 ` Jes Sorensen
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=544652f0-97d4-d228-7832-cd0268727433@gmail.com \
--to=jes.sorensen@gmail.com \
--cc=linux-raid@vger.kernel.org \
--cc=mariusz.tkaczyk@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).