From: Alasdair G Kergon <agk@redhat.com>
To: Jonathan Brassow <jbrassow@redhat.com>
Cc: linux-raid@vger.kernel.org, dm-devel@redhat.com, agk@redhat.com
Subject: Re: [dm-devel] [PATCH] DM RAID: Add message/status support for changing sync action
Date: Sun, 17 Mar 2013 22:52:16 +0000 [thread overview]
Message-ID: <20130317225216.GA20480@agk-dp.fab.redhat.com> (raw)
In-Reply-To: <1363380503.5163.2.camel@f16>
On Fri, Mar 15, 2013 at 03:48:23PM -0500, Jon Brassow wrote:
> DM RAID: Add message/status support for changing sync action
Quick points:
> Two additional fields
(which are *always* populated)
> have been added
appended
> to the status output to provide more
> information about the type of sync action occurring and the results of those
> actions, specifically: <sync_action> and <mismatch_cnt>. This is essentially
> the device-mapper way of doing what MD controls through the 'sync_action'
> sysfs file and shows through the 'mismatch_cnt' sysfs file.
> + char *sync_action_type = "idle";
(const?)
> + /*
> + * Sync action:
> + * See Documentation/device-mapper/dm-raid.c for
> + * information on each of these states.
> + */
> + if (test_bit(MD_RECOVERY_FROZEN, &rs->md.recovery))
> + sync_action_type = "frozen";
> + else if (test_bit(MD_RECOVERY_RUNNING, &rs->md.recovery) ||
> + (!rs->md.ro && test_bit(MD_RECOVERY_NEEDED,
> + &rs->md.recovery))) {
> + if (test_bit(MD_RECOVERY_RESHAPE, &rs->md.recovery))
> + sync_action_type = "reshape";
> + else if (test_bit(MD_RECOVERY_SYNC, &rs->md.recovery)) {
> + if (!test_bit(MD_RECOVERY_REQUESTED,
> + &rs->md.recovery))
> + sync_action_type = "resync";
> + else if (test_bit(MD_RECOVERY_CHECK,
> + &rs->md.recovery))
> + sync_action_type = "check";
> + else
> + sync_action_type = "repair";
> + } else if (test_bit(MD_RECOVERY_RECOVER,
> + &rs->md.recovery))
> + sync_action_type = "recover";
> + }
Move this out into a fn that can simply return once it's selected
the most appropriate string?
> - .version = {1, 4, 1},
> + .version = {1, 4, 2},
1.5.0 - inc minor when the change affects interface or behaviour in a non-neglible way
Alasdair
prev parent reply other threads:[~2013-03-17 22:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-15 20:48 [PATCH] DM RAID: Add message/status support for changing sync action Jonathan Brassow
2013-03-17 22:35 ` NeilBrown
2013-03-19 16:54 ` Brassow Jonathan
2013-03-17 22:52 ` Alasdair G Kergon [this message]
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=20130317225216.GA20480@agk-dp.fab.redhat.com \
--to=agk@redhat.com \
--cc=dm-devel@redhat.com \
--cc=jbrassow@redhat.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 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).