[PATCH v3] Monitor: print message before quit for no array to monitor

Subsystems: the rest

STALE1713d

6 messages, 2 authors, 2021-12-09 · open the first message on its own page

[PATCH v3] Monitor: print message before quit for no array to monitor

From: Coly Li <hidden>
Date: 2021-09-02 07:32:30

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 <redacted>
Suggested-by: Mariusz Tkaczyk <redacted>
Signed-off-by: Coly Li <redacted>
Cc: Jes Sorensen <redacted>
---
Changelog:
v3: modify printed message by suggestion from Mariusz.
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..839ec78 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("No array with redundancy detected, stopping\n");
 				break;
 			}
 			else {
-- 
2.31.1

Re: [PATCH v3] Monitor: print message before quit for no array to monitor

From: Coly Li <hidden>
Date: 2021-12-05 13:39:10

Hi  Jes,

Could you take this one for 4.2? It is posted for a while, which fixes a 
bug report of mine.

Thanks.

Coly Li

On 9/2/21 3:32 PM, Coly Li wrote:
quoted hunk
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 <redacted>
Suggested-by: Mariusz Tkaczyk <redacted>
Signed-off-by: Coly Li <redacted>
Cc: Jes Sorensen <redacted>
---
Changelog:
v3: modify printed message by suggestion from Mariusz.
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..839ec78 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("No array with redundancy detected, stopping\n");
  				break;
  			}
  			else {

Re: [PATCH v3] Monitor: print message before quit for no array to monitor

From: Jes Sorensen <hidden>
Date: 2021-12-08 14:45:24

Hi Coly,

Didn't see this one as it was only copied to my work email. Sorry.

Applied!

Thanks,
Jes

On 12/5/21 8:39 AM, Coly Li wrote:
Hi  Jes,

Could you take this one for 4.2? It is posted for a while, which fixes a
bug report of mine.

Thanks.

Coly Li

On 9/2/21 3:32 PM, Coly Li wrote:
quoted
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 <redacted>
Suggested-by: Mariusz Tkaczyk <redacted>
Signed-off-by: Coly Li <redacted>
Cc: Jes Sorensen <redacted>
---
Changelog:
v3: modify printed message by suggestion from Mariusz.
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..839ec78 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("No array with redundancy detected, stopping\n");
                  break;
              }
              else {

Re: [PATCH v3] Monitor: print message before quit for no array to monitor

From: Coly Li <hidden>
Date: 2021-12-09 01:18:24

On 12/8/21 10:45 PM, Jes Sorensen wrote:

Hi Jes,
Hi Coly,

Didn't see this one as it was only copied to my work email. Sorry.
It should be my fault, I didn't notice that jes@trained-monkey.org was 
the proper email address :-)
Applied!
Thanks. I will post patches to the trained-monkey.org address in future.

Coly Li

Re: [PATCH v3] Monitor: print message before quit for no array to monitor

From: Jes Sorensen <hidden>
Date: 2021-12-09 14:31:29

On 12/8/21 8:18 PM, Coly Li wrote:
On 12/8/21 10:45 PM, Jes Sorensen wrote:

Hi Jes,
quoted
Hi Coly,

Didn't see this one as it was only copied to my work email. Sorry.
It should be my fault, I didn't notice that jes@trained-monkey.org was
the proper email address :-)
quoted
Applied!
Thanks. I will post patches to the trained-monkey.org address in future.
Great, thanks!

Anything else we want for 4.2?

Jes

Re: [PATCH v3] Monitor: print message before quit for no array to monitor

From: Coly Li <hidden>
Date: 2021-12-09 14:37:48

On 12/9/21 10:31 PM, Jes Sorensen wrote:
On 12/8/21 8:18 PM, Coly Li wrote:
quoted
On 12/8/21 10:45 PM, Jes Sorensen wrote:

Hi Jes,
quoted
Hi Coly,

Didn't see this one as it was only copied to my work email. Sorry.
It should be my fault, I didn't notice that jes@trained-monkey.org was
the proper email address :-)
quoted
Applied!
Thanks. I will post patches to the trained-monkey.org address in future.
Great, thanks!

Anything else we want for 4.2?
No more from my side. Thanks.

Coly Li
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help