linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] Monitor: print message before quit for no array to monitor
@ 2021-09-02  2:36 Coly Li
  2021-09-02  7:08 ` Tkaczyk, Mariusz
  0 siblings, 1 reply; 3+ messages in thread
From: Coly Li @ 2021-09-02  2:36 UTC (permalink / raw)
  To: linux-raid; +Cc: Coly Li, George Gkioulis, Jes Sorensen

If there is no array device to monitor, Monitor() will stop monitoring
at line 261 from the following code block,
 257                 if (!new_found) {
 258                         if (oneshot)
 259                                 break;
 260                         else if (!anyredundant) {
 261                                 break;
 262                         }

This change was introduced by commit 007087d0898a ("Monitor: stop
notifing about containers"). Before this commit, Monitor() will continue
and won't quit even there is no array to monitor.

It is fine to quit without any array device to monitor, but users may
wonder whether there is something wrong with mdadm program or their
configuration to make mdadm quit monitoring.

This patch adds a simple error message to indicate Monitor() quits for
array device to monitor, which makes users have hint to understand why
mdadm stops monitoring.

Reported-by: George Gkioulis <ggkioulis@suse.com>
Signed-off-by: Coly Li <colyli@suse.de>
Cc: Jes Sorensen <jsorensen@fb.com>
---
Changelog:
v2: add CC to Jes, and fix typo.
v1: the original version.

 Monitor.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Monitor.c b/Monitor.c
index f541229..5f399c4 100644
--- a/Monitor.c
+++ b/Monitor.c
@@ -258,6 +258,7 @@ int Monitor(struct mddev_dev *devlist,
 			if (oneshot)
 				break;
 			else if (!anyredundant) {
+				pr_err("Stop for no array to monitor\n");
 				break;
 			}
 			else {
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] Monitor: print message before quit for no array to monitor
  2021-09-02  2:36 [PATCH v2] Monitor: print message before quit for no array to monitor Coly Li
@ 2021-09-02  7:08 ` Tkaczyk, Mariusz
  2021-09-02  7:26   ` Coly Li
  0 siblings, 1 reply; 3+ messages in thread
From: Tkaczyk, Mariusz @ 2021-09-02  7:08 UTC (permalink / raw)
  To: Coly Li, linux-raid; +Cc: George Gkioulis, Jes Sorensen

Hi Coly,
On 02.09.2021 04:36, Coly Li wrote:
> @@ -258,6 +258,7 @@ int Monitor(struct mddev_dev *devlist,
>   			if (oneshot)
>   				break;
>   			else if (!anyredundant) {
> +				pr_err("Stop for no array to monitor\n");
>   				break;

IMO the message is not precise enough. See that if there is only raid0
then it also stops. Something like:
"No array with redundancy detected, stopping" is more detailed.

Thanks,
Mariusz


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] Monitor: print message before quit for no array to monitor
  2021-09-02  7:08 ` Tkaczyk, Mariusz
@ 2021-09-02  7:26   ` Coly Li
  0 siblings, 0 replies; 3+ messages in thread
From: Coly Li @ 2021-09-02  7:26 UTC (permalink / raw)
  To: Tkaczyk, Mariusz; +Cc: George Gkioulis, Jes Sorensen, linux-raid

On 9/2/21 3:08 PM, Tkaczyk, Mariusz wrote:
> Hi Coly,
> On 02.09.2021 04:36, Coly Li wrote:
>> @@ -258,6 +258,7 @@ int Monitor(struct mddev_dev *devlist,
>>               if (oneshot)
>>                   break;
>>               else if (!anyredundant) {
>> +                pr_err("Stop for no array to monitor\n");
>>                   break;
>
> IMO the message is not precise enough. See that if there is only raid0
> then it also stops. Something like:
> "No array with redundancy detected, stopping" is more detailed.

Copied. I will post v3 patch with your suggestion.

Thanks.

Coly Li

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-09-02  7:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-02  2:36 [PATCH v2] Monitor: print message before quit for no array to monitor Coly Li
2021-09-02  7:08 ` Tkaczyk, Mariusz
2021-09-02  7:26   ` Coly Li

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).