linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] mdadm: let cluster raid could also add disk within incremental mode
@ 2015-11-19  5:59 Guoqing Jiang
  2015-11-19  5:59 ` [PATCH 2/2] mdadm: output info more precisely when change bitmap Guoqing Jiang
  0 siblings, 1 reply; 2+ messages in thread
From: Guoqing Jiang @ 2015-11-19  5:59 UTC (permalink / raw)
  To: neilb; +Cc: rgoldwyn, linux-raid, Guoqing Jiang

For cluster raid, the disc.state need to be changed accordingly under
incremental mode.

Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
Signed-off-by: Guoqing Jiang <gqjiang@suse.com>
---
 Incremental.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Incremental.c b/Incremental.c
index 781d27d..7afa7d7 100644
--- a/Incremental.c
+++ b/Incremental.c
@@ -444,6 +444,10 @@ int Incremental(struct mddev_dev *devlist, struct context *c,
 		/* add disk needs to know about containers */
 		if (st->ss->external)
 			sra->array.level = LEVEL_CONTAINER;
+
+		if (info.array.state & (1 << MD_SB_CLUSTERED))
+			info.disk.state |= (1 << MD_DISK_CLUSTER_ADD);
+
 		err = add_disk(mdfd, st, sra, &info);
 		if (err < 0 && errno == EBUSY) {
 			/* could be another device present with the same
-- 
2.1.4


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

* [PATCH 2/2] mdadm: output info more precisely when change bitmap
  2015-11-19  5:59 [PATCH 1/2] mdadm: let cluster raid could also add disk within incremental mode Guoqing Jiang
@ 2015-11-19  5:59 ` Guoqing Jiang
  0 siblings, 0 replies; 2+ messages in thread
From: Guoqing Jiang @ 2015-11-19  5:59 UTC (permalink / raw)
  To: neilb; +Cc: rgoldwyn, linux-raid, Guoqing Jiang

When change bitmap to none, the infos could be more accurate
based on existed state type.

And s->bitmap_file is passed from cmd "--bitmap=TYPE", so remove
s->bitmap_file from err info since it should means change the
bitmap to one type failed rather than the type is already present.
    
Signed-off-by: Guoqing Jiang <gqjiang@suse.com>
---
 Grow.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/Grow.c b/Grow.c
index 80d7b22..30ff7f3 100644
--- a/Grow.c
+++ b/Grow.c
@@ -328,12 +328,15 @@ int Grow_addbitmap(char *devname, int fd, struct context *c, struct shape *s)
 		if (strcmp(s->bitmap_file, "none")==0) {
 			array.state &= ~(1<<MD_SB_BITMAP_PRESENT);
 			if (ioctl(fd, SET_ARRAY_INFO, &array)!= 0) {
-				pr_err("failed to remove internal bitmap.\n");
+				if (array.state & (1<<MD_SB_CLUSTERED))
+					pr_err("failed to remove clustered bitmap.\n");
+				else
+					pr_err("failed to remove internal bitmap.\n");
 				return 1;
 			}
 			return 0;
 		}
-		pr_err("%s bitmap already present on %s\n", s->bitmap_file, devname);
+		pr_err("bitmap already present on %s\n", devname);
 		return 1;
 	}
 
-- 
2.1.4


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

end of thread, other threads:[~2015-11-19  5:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-19  5:59 [PATCH 1/2] mdadm: let cluster raid could also add disk within incremental mode Guoqing Jiang
2015-11-19  5:59 ` [PATCH 2/2] mdadm: output info more precisely when change bitmap Guoqing Jiang

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