From: Jes Sorensen <Jes.Sorensen@redhat.com>
To: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Cc: linux-raid@vger.kernel.org
Subject: Re: [PATCH v2 6/7] Allow changing the RWH policy for a running array
Date: Tue, 06 Dec 2016 09:30:22 -0500 [thread overview]
Message-ID: <wrfj1sxl870h.fsf@redhat.com> (raw)
In-Reply-To: <5c74d40c-36c4-97ae-9a67-be533d6abfb1@intel.com> (Artur Paszkiewicz's message of "Tue, 6 Dec 2016 08:43:40 +0100")
Artur Paszkiewicz <artur.paszkiewicz@intel.com> writes:
> On 12/05/2016 10:50 PM, Jes Sorensen wrote:
>> Artur Paszkiewicz <artur.paszkiewicz@intel.com> writes:
>>> This extends the --rwh-policy parameter to work also in Misc mode. Using
>>> it changes the currently active RWH policy in the kernel driver and
>>> updates the metadata to make this change permanent. Updating metadata is
>>> not yet implemented for super1, so this is limited to IMSM for now.
>>>
>>> Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
>>
>> Hi Artur,
>>
>> It looked good all the way up until 6/7, but there is a nit here:
>>
>>> ---
>>> Manage.c | 79
>>> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>>> mdadm.c | 9 +++++++
>>> mdadm.h | 1 +
>>> super-intel.c | 65 +++++++++++++++++++++++++++++++++++++++++++++++-
>>> 4 files changed, 153 insertions(+), 1 deletion(-)
>> [snip]
>>> diff --git a/super-intel.c b/super-intel.c
>>> index e524ef0..3b40429 100644
>>> --- a/super-intel.c
>>> +++ b/super-intel.c
>>> @@ -448,6 +448,7 @@ enum imsm_update_type {
>>> update_general_migration_checkpoint,
>>> update_size_change,
>>> update_prealloc_badblocks_mem,
>>> + update_rwh_policy,
>>> };
>>>
>>> struct imsm_update_activate_spare {
>>> @@ -540,6 +541,12 @@ struct imsm_update_prealloc_bb_mem {
>>> enum imsm_update_type type;
>>> };
>>>
>>> +struct imsm_update_rwh_policy {
>>> + enum imsm_update_type type;
>>> + int new_policy;
>>> + int dev_idx;
>>> +};
>>> +
>>> static const char *_sys_dev_type[] = {
>>> [SYS_DEV_UNKNOWN] = "Unknown",
>>> [SYS_DEV_SAS] = "SAS",
>>> @@ -3175,7 +3182,6 @@ static void getinfo_super_imsm_volume(struct supertype *st, struct mdinfo *info,
>>> info->custom_array_size <<= 32;
>>> info->custom_array_size |= __le32_to_cpu(dev->size_low);
>>> info->recovery_blocked = imsm_reshape_blocks_arrays_changes(st->sb);
>>> - info->journal_clean = dev->rwh_policy;
>>>
>>> if (is_gen_migration(dev)) {
>>> info->reshape_active = 1;
>>> @@ -3347,6 +3353,8 @@ static void getinfo_super_imsm_volume(struct supertype *st, struct mdinfo *info,
>>> info->rwh_policy = RWH_POLICY_PPL;
>>> else
>>> info->rwh_policy = RWH_POLICY_UNKNOWN;
>>> +
>>> + info->journal_clean = info->rwh_policy == RWH_POLICY_PPL;
>>> }
>>> }
>>
>> This part doesn't make sense, first you set info->rwh_policy based on
>> sb->feature_map to RWH_POLICY_PPL or RWH_POLICY_UNKNOWN and then right
>> after you hard set it to RWH_POLICY_PPL.
>>
>> In general I really would prefer not to see any of those double
>> assignments if it can be avoided.
>
> This isn't a double assignment, there is a '==' there. I'm setting
> info->journal_clean to true only if the policy is PPL. I'm not sure how
> this change ended up in this patch, it was supposed to go to 5/7. I must
> have overlooked it.
Argh you're right, code obfuscation at it's finest - if this is meant to
be in 5/7 do you want to respin the two?
In addition why not put the info->journal_clean assignments up together
with the info->rhw_policy assignments? Would make it a lot easier to
read without making my mistake :)
cheers,
Jes
next prev parent reply other threads:[~2016-12-06 14:30 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-05 15:31 [PATCH v2 0/7] mdadm support for Partial Parity Log Artur Paszkiewicz
2016-12-05 15:31 ` [PATCH v2 1/7] imsm: metadata changes for PPL Artur Paszkiewicz
2016-12-05 15:31 ` [PATCH v2 2/7] Generic support for --rwh-policy and PPL Artur Paszkiewicz
2016-12-05 15:32 ` [PATCH v2 3/7] imsm: PPL support Artur Paszkiewicz
2016-12-05 15:32 ` [PATCH v2 4/7] super1: " Artur Paszkiewicz
2016-12-05 15:32 ` [PATCH v2 5/7] imsm: allow to assemble with PPL even if dirty degraded Artur Paszkiewicz
2016-12-05 15:32 ` [PATCH v2 6/7] Allow changing the RWH policy for a running array Artur Paszkiewicz
2016-12-05 21:50 ` Jes Sorensen
2016-12-06 7:43 ` Artur Paszkiewicz
2016-12-06 14:30 ` Jes Sorensen [this message]
2016-12-06 14:50 ` Artur Paszkiewicz
2016-12-06 15:08 ` Jes Sorensen
2016-12-06 15:30 ` Artur Paszkiewicz
2016-12-06 15:38 ` Jes Sorensen
2016-12-05 15:32 ` [PATCH v2 7/7] Man page changes for --rwh-policy Artur Paszkiewicz
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=wrfj1sxl870h.fsf@redhat.com \
--to=jes.sorensen@redhat.com \
--cc=artur.paszkiewicz@intel.com \
--cc=linux-raid@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.