Skip to contentSkip to conversation

multipath-tools libmultipath/configure.c libmu ...

PATCH [email protected] 5 participants 11 messages Sep 19, 2008 – Dec 18, 2008 Device mapper

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/dm
Module name: multipath-tools
Branch: RHEL5_FC6
Changes by: [email protected] 2008-09-19 03:27:08

Modified files:
libmultipath : configure.c configure.h devmapper.c devmapper.h
multipathd : cli.c cli.h cli_handlers.c cli_handlers.h
main.c main.h

Log message:
Fix for bz #455692. There is now a command for multipathd, 'resize map'. This does online grows or shrinks for your multipath device. It has some warts.

1. It needs to remove and re-add every path in the device. This can cause two annoyances. First, if you only have one valid path, you go into an all paths down scenario. However, you will immediately re-add the path, so it won't trigger problem #2. Second, if the path is inaccessable, you may not be able to re-add it.

2. You can't disable flushing on suspend for a device-mapper device, when you want to change size. This means that if all your paths are down, you will fail the queued IOs when you suspend. This is a problem with the device-mapper kernel code, and there's no real way to avoid it, except by fixing it in the kernel.

This commit also has some minor fixups for 238421, and adds the ability to disable and restore queueing on all multipath devices through multipathd

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/configure.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.2.2.3&r2=1.2.2.4
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/configure.h.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.1&r2=1.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/devmapper.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.22.2.5&r2=1.22.2.6
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/devmapper.h.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.11.2.4&r2=1.11.2.5
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipathd/cli.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.5.2.2&r2=1.5.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipathd/cli.h.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.5.2.2&r2=1.5.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipathd/cli_handlers.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.6.2.2&r2=1.6.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipathd/cli_handlers.h.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.3.2.2&r2=1.3.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipathd/main.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.69.2.13&r2=1.69.2.14
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipathd/main.h.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.7&r2=1.7.2.1

libmultipath/configure.c +10 -1
@@ -360,7 +360,16 @@
 			r = dm_addmap(DM_DEVICE_RELOAD, DEFAULT_TARGET, mpp, 0,
 				      1);
 		if (r)
-			r = dm_simplecmd(DM_DEVICE_RESUME, mpp->alias);
+			r = dm_simplecmd(DM_DEVICE_RESUME, mpp->alias, 1);
+		break;
+
+	case ACT_RESIZE:
+		r = dm_addmap(DM_DEVICE_RELOAD, DEFAULT_TARGET, mpp, 0, 0);
+		if (!r)
+			r = dm_addmap(DM_DEVICE_RELOAD, DEFAULT_TARGET, mpp, 0,
+				      1);
+		if (r)
+			r = dm_simplecmd(DM_DEVICE_RESUME, mpp->alias, 0);
 		break;
 
 	case ACT_RENAME:
libmultipath/configure.h +2 -1
@@ -15,7 +15,8 @@
 	ACT_RELOAD,
 	ACT_SWITCHPG,
 	ACT_RENAME,
-	ACT_CREATE
+	ACT_CREATE,
+	ACT_RESIZE,
 };
 
 #define FLUSH_ONE 1
libmultipath/devmapper.c +5 -4
@@ -130,7 +130,7 @@
 }
 
 extern int
-dm_simplecmd (int task, const char *name) {
+dm_simplecmd (int task, const char *name, int no_flush) {
 	int r = 0;
 	struct dm_task *dmt;
 
@@ -142,7 +142,8 @@
 
 	dm_task_no_open_count(dmt);
 	dm_task_skip_lockfs(dmt);       /* for DM_DEVICE_RESUME */
-	dm_task_no_flush(dmt);		/* for DM_DEVICE_SUSPEND/RESUME */
+	if (no_flush)
+		dm_task_no_flush(dmt);		/* for DM_DEVICE_SUSPEND/RESUME */
 
 	r = dm_task_run (dmt);
 
@@ -474,7 +475,7 @@
 		return 1;
 	}	
 
-	r = dm_simplecmd(DM_DEVICE_REMOVE, mapname);
+	r = dm_simplecmd(DM_DEVICE_REMOVE, mapname, 0);
 
 	if (r) {
 		condlog(4, "multipath map %s removed", mapname);
@@ -883,7 +884,7 @@
 				 */
 				condlog(4, "partition map %s removed",
 					names->name);
-				dm_simplecmd(DM_DEVICE_REMOVE, names->name);
+				dm_simplecmd(DM_DEVICE_REMOVE, names->name, 0);
 		   }
 
 		next = names->next;
libmultipath/devmapper.h +1 -1
@@ -4,7 +4,7 @@
 
 void dm_init(void);
 int dm_prereq (char *, int, int, int);
-int dm_simplecmd (int, const char *);
+int dm_simplecmd (int, const char *, int);
 int dm_addmap (int, const char *, struct multipath *, int, int); 
 int dm_map_present (char *);
 int dm_get_map(char *, unsigned long long *, char *);
multipathd/cli.c +1 -0
@@ -131,6 +131,7 @@
 	r += add_key(keys, "fail", FAIL, 0);
 	r += add_key(keys, "disablequeueing", DISABLEQ, 0);
 	r += add_key(keys, "restorequeueing", RESTOREQ, 0);
+	r += add_key(keys, "resize", RESIZE, 0);
 	r += add_key(keys, "paths", PATHS, 0);
 	r += add_key(keys, "maps", MAPS, 0);
 	r += add_key(keys, "multipaths", MAPS, 0);
multipathd/cli.h +2 -0
@@ -9,6 +9,7 @@
 	__FAIL,
 	__DISABLEQ,
 	__RESTOREQ,
+	__RESIZE,
 	__PATHS,
 	__MAPS,
 	__PATH,
@@ -33,6 +34,7 @@
 #define FAIL		(1 << __FAIL)
 #define DISABLEQ	(1 << __DISABLEQ)
 #define RESTOREQ	(1 << __RESTOREQ)
+#define RESIZE		(1 << __RESIZE)
 #define PATHS		(1 << __PATHS)
 #define MAPS		(1 << __MAPS)
 #define PATH		(1 << __PATH)
multipathd/cli_handlers.c +176 -2

230 lines not on this page · raw message

multipathd/cli_handlers.h +3 -0
@@ -14,7 +14,10 @@
 int cli_switch_group(void * v, char ** reply, int * len, void * data);
 int cli_reconfigure(void * v, char ** reply, int * len, void * data);
 int cli_disable_queueing(void * v, char ** reply, int * len, void * data);
+int cli_disable_all_queueing(void * v, char ** reply, int * len, void * data);
 int cli_restore_queueing(void * v, char ** reply, int * len, void * data);
+int cli_restore_all_queueing(void * v, char ** reply, int * len, void * data);
+int cli_resize(void * v, char ** reply, int * len, void * data);
 int cli_suspend(void * v, char ** reply, int * len, void * data);
 int cli_resume(void * v, char ** reply, int * len, void * data);
 int cli_reinstate(void * v, char ** reply, int * len, void * data);
multipathd/main.c +4 -1
@@ -158,7 +158,7 @@
 	return 0;
 }
 
-static void
+void
 sync_map_state(struct multipath *mpp)
 {
 	struct pathgroup *pgp;
@@ -768,6 +768,9 @@
 	add_handler(FAIL+PATH, cli_fail);
 	add_handler(DISABLEQ+MAP, cli_disable_queueing);
 	add_handler(RESTOREQ+MAP, cli_restore_queueing);
+	add_handler(DISABLEQ+MAPS, cli_disable_all_queueing);
+	add_handler(RESTOREQ+MAPS, cli_restore_all_queueing);
+	add_handler(RESIZE+MAP, cli_resize);
 
 	uxsock_listen(&uxsock_trigger, ap);
 
multipathd/main.h +1 -0
@@ -9,5 +9,6 @@
 int ev_remove_path (char *, struct vectors *);
 int ev_add_map (char *, struct vectors *);
 int ev_remove_map (char *, struct vectors *);
+void sync_map_state (struct multipath *);
 
 #endif /* MAIN_H */
#1 lore raw
Quoted 20 lines · On Fri, Sep 19, 2008 at 03:27:10AM -0000, [email protected] wrote:

CVSROOT: /cvs/dm
Module name: multipath-tools
Branch: RHEL5_FC6
Changes by: [email protected] 2008-09-19 03:27:08

Modified files:
libmultipath : configure.c configure.h devmapper.c devmapper.h
multipathd : cli.c cli.h cli_handlers.c cli_handlers.h
main.c main.h

Log message:
Fix for bz #455692. There is now a command for multipathd, 'resize map'. This does online grows or shrinks for your multipath device. It has some warts.

1. It needs to remove and re-add every path in the device. This can cause two annoyances. First, if you only have one valid path, you go into an all paths down scenario. However, you will immediately re-add the path, so it won't trigger problem #2. Second, if the path is inaccessable, you may not be able to re-add it.

Quoted 8 lines

2. You can't disable flushing on suspend for a device-mapper device, when you want to change size. This means that if all your paths are down, you will fail the queued IOs when you suspend. This is a problem with the device-mapper kernel code, and there's no real way to avoid it, except by fixing it in the kernel.

This commit also has some minor fixups for 238421, and adds the ability to disable and restore queueing on all multipath devices through multipathd

Nice!!

So now we have SCSI disk online resizing, and dm-multipath online resizing. Excellent.

I assume both of these will be in RHEL 5.3?

-- Pasi

#2 lore raw
In reply to [email protected]
Quoted 28 lines · On Fri, Sep 19, 2008 at 03:27:10AM -0000, [email protected] wrote:

CVSROOT: /cvs/dm
Module name: multipath-tools
Branch: RHEL5_FC6
Changes by: [email protected] 2008-09-19 03:27:08

Modified files:
libmultipath : configure.c configure.h devmapper.c devmapper.h
multipathd : cli.c cli.h cli_handlers.c cli_handlers.h
main.c main.h

Log message:
Fix for bz #455692. There is now a command for multipathd, 'resize map'. This does online grows or shrinks for your multipath device. It has some warts.

1. It needs to remove and re-add every path in the device. This can cause two annoyances. First, if you only have one valid path, you go into an all paths down scenario. However, you will immediately re-add the path, so it won't trigger problem #2. Second, if the path is inaccessable, you may not be able to re-add it.

2. You can't disable flushing on suspend for a device-mapper device, when you want to change size. This means that if all your paths are down, you will fail the queued IOs when you suspend. This is a problem with the device-mapper kernel code, and there's no real way to avoid it, except by fixing it in the kernel.

This commit also has some minor fixups for 238421, and adds the ability to disable and restore queueing on all multipath devices through multipathd

Quoted 12 lines

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/configure.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.2.2.3&r2=1.2.2.4
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/configure.h.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.1&r2=1.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/devmapper.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.22.2.5&r2=1.22.2.6
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/devmapper.h.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.11.2.4&r2=1.11.2.5
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipathd/cli.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.5.2.2&r2=1.5.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipathd/cli.h.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.5.2.2&r2=1.5.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipathd/cli_handlers.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.6.2.2&r2=1.6.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipathd/cli_handlers.h.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.3.2.2&r2=1.3.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipathd/main.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.69.2.13&r2=1.69.2.14
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipathd/main.h.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.7&r2=1.7.2.1

Where can I get the multipath-tools sources that these patches apply cleanly to? They do not apply cleanly to my multipath 0.4.8 sources, add there seems to be some major differences in some places.

Thanks,

Andy

#3 lore raw
Quoted 42 lines · Andy
Quoted 28 lines · On Fri, Sep 19, 2008 at 03:27:10AM -0000, [email protected] wrote:

CVSROOT: /cvs/dm
Module name: multipath-tools
Branch: RHEL5_FC6
Changes by: [email protected] 2008-09-19 03:27:08

Modified files:
libmultipath : configure.c configure.h devmapper.c devmapper.h
multipathd : cli.c cli.h cli_handlers.c cli_handlers.h
main.c main.h

Log message:
Fix for bz #455692. There is now a command for multipathd, 'resize map'. This does online grows or shrinks for your multipath device. It has some warts.

1. It needs to remove and re-add every path in the device. This can cause two annoyances. First, if you only have one valid path, you go into an all paths down scenario. However, you will immediately re-add the path, so it won't trigger problem #2. Second, if the path is inaccessable, you may not be able to re-add it.

2. You can't disable flushing on suspend for a device-mapper device, when you want to change size. This means that if all your paths are down, you will fail the queued IOs when you suspend. This is a problem with the device-mapper kernel code, and there's no real way to avoid it, except by fixing it in the kernel.

This commit also has some minor fixups for 238421, and adds the ability to disable and restore queueing on all multipath devices through multipathd

Quoted 12 lines

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/configure.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.2.2.3&r2=1.2.2.4
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/configure.h.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.1&r2=1.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/devmapper.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.22.2.5&r2=1.22.2.6
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/devmapper.h.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.11.2.4&r2=1.11.2.5
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipathd/cli.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.5.2.2&r2=1.5.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipathd/cli.h.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.5.2.2&r2=1.5.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipathd/cli_handlers.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.6.2.2&r2=1.6.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipathd/cli_handlers.h.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.3.2.2&r2=1.3.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipathd/main.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.69.2.13&r2=1.69.2.14
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipathd/main.h.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.7&r2=1.7.2.1

Quoted 8 lines

Where can I get the multipath-tools sources that these patches apply cleanly to? They do not apply cleanly to my multipath 0.4.8 sources, add there seems to be some major differences in some places.

Thanks,

Andy

Responding to my own mail, I did got the source with the patches from the cvs. But, the resizing does not work for with with mounted volumes. There are 4 paths for the volume, so there is no probably with it failing paths. I get "domap(0) failure for create/reload map" when I run multipath -v 3.

I can get dm to reconize the new size if the volume is umounted. But, I really would like it to work while it is mounted.

Andy

#4 lore raw
Quoted 52 lines · Andy
Quoted 42 lines · Andy
Quoted 28 lines · On Fri, Sep 19, 2008 at 03:27:10AM -0000, [email protected] wrote:

CVSROOT: /cvs/dm
Module name: multipath-tools
Branch: RHEL5_FC6
Changes by: [email protected] 2008-09-19 03:27:08

Modified files:
libmultipath : configure.c configure.h devmapper.c devmapper.h
multipathd : cli.c cli.h cli_handlers.c cli_handlers.h
main.c main.h

Log message:
Fix for bz #455692. There is now a command for multipathd, 'resize map'. This does online grows or shrinks for your multipath device. It has some warts.

1. It needs to remove and re-add every path in the device. This can cause two annoyances. First, if you only have one valid path, you go into an all paths down scenario. However, you will immediately re-add the path, so it won't trigger problem #2. Second, if the path is inaccessable, you may not be able to re-add it.

2. You can't disable flushing on suspend for a device-mapper device, when you want to change size. This means that if all your paths are down, you will fail the queued IOs when you suspend. This is a problem with the device-mapper kernel code, and there's no real way to avoid it, except by fixing it in the kernel.

This commit also has some minor fixups for 238421, and adds the ability to disable and restore queueing on all multipath devices through multipathd

Quoted 12 lines

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/configure.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.2.2.3&r2=1.2.2.4
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/configure.h.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.1&r2=1.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/devmapper.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.22.2.5&r2=1.22.2.6
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/devmapper.h.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.11.2.4&r2=1.11.2.5
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipathd/cli.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.5.2.2&r2=1.5.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipathd/cli.h.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.5.2.2&r2=1.5.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipathd/cli_handlers.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.6.2.2&r2=1.6.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipathd/cli_handlers.h.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.3.2.2&r2=1.3.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipathd/main.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.69.2.13&r2=1.69.2.14
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipathd/main.h.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.7&r2=1.7.2.1

Quoted 8 lines

Where can I get the multipath-tools sources that these patches apply cleanly to? They do not apply cleanly to my multipath 0.4.8 sources, add there seems to be some major differences in some places.

Thanks,

Andy

Quoted 8 lines

Responding to my own mail, I did got the source with the patches from the cvs. But, the resizing does not work for with with mounted volumes. There are 4 paths for the volume, so there is no probably with it failing paths. I get "domap(0) failure for create/reload map" when I run multipath -v 3.

I can get dm to reconize the new size if the volume is umounted. But, I really would like it to work while it is mounted.

It should work for mounted volumes. Did you try
multipathd -k"resize map <mapname>"

Since this requires suspending without the no_flush option, I didn't want to have it happen on a normal reload, and since without the kernel fixes, this required removing and then readding paths, I did it through multipathd.

So just running multipath -v3 after a path resize won't work. In fact, I think it might leave the devices in the suspended state, since the resume fails.

-Ben

Quoted 6 lines

Andy

--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel

#5 lore raw
Quoted 13 lines · Benjamin Marzinski
Quoted 9 lines

Responding to my own mail, I did got the source with the patches from the cvs. But, the resizing does not work for with with mounted volumes. There are 4 paths for the volume, so there is no probably with it failing paths. I get "domap(0) failure for create/reload map" when I run multipath -v 3.

I can get dm to reconize the new size if the volume is umounted. But, I really would like it to work while it is mounted.

It should work for mounted volumes. Did you try
multipathd -k"resize map <mapname>"

Quoted 9 lines

Since this requires suspending without the no_flush option, I didn't want to have it happen on a normal reload, and since without the kernel fixes, this required removing and then readding paths, I did it through multipathd.

So just running multipath -v3 after a path resize won't work. In fact, I think it might leave the devices in the suspended state, since the resume fails.

Hi!

I just tried this but I'm having problems getting it to work..

# multipathd -k"resize map mpath-resize-test"
fail

The underlying SCSI devices have been online resized already, and verified from dmesg and from /proc/partitions to be bigger.

I'm running rhel5 kernel with scsi online resize patches (2.6.18-93.el5.bz444964.2) and dm-multipath testing packages with support for online resizing (device-mapper-multipath-0.4.7-19.el5.i386.rpm).

Any ideas?

-- Pasi

#6 lore raw
Quoted 31 lines · Pasi Kärkkäinen
Quoted 13 lines · Benjamin Marzinski
Quoted 9 lines

Responding to my own mail, I did got the source with the patches from the cvs. But, the resizing does not work for with with mounted volumes. There are 4 paths for the volume, so there is no probably with it failing paths. I get "domap(0) failure for create/reload map" when I run multipath -v 3.

I can get dm to reconize the new size if the volume is umounted. But, I really would like it to work while it is mounted.

It should work for mounted volumes. Did you try
multipathd -k"resize map <mapname>"

Quoted 9 lines

Since this requires suspending without the no_flush option, I didn't want to have it happen on a normal reload, and since without the kernel fixes, this required removing and then readding paths, I did it through multipathd.

So just running multipath -v3 after a path resize won't work. In fact, I think it might leave the devices in the suspended state, since the resume fails.

Hi!

I just tried this but I'm having problems getting it to work..

# multipathd -k"resize map mpath-resize-test"
fail
Quoted 9 lines

The underlying SCSI devices have been online resized already, and verified from dmesg and from /proc/partitions to be bigger.

I'm running rhel5 kernel with scsi online resize patches (2.6.18-93.el5.bz444964.2) and dm-multipath testing packages with support for online resizing (device-mapper-multipath-0.4.7-19.el5.i386.rpm).

Any ideas?

Actually I think the problem was that I had not yet reloaded multipathd configuration, so my underlying devices were still blacklisted according to multipathd -k"show devices".. but still I had the mpath-device up and running :) Oh well..

I ran "/etc/init.d/multipathd reload" and then:

# multipathd -k"resize map mpath-resize-test"
ok

But "multipath -ll" still shows the mpath-resize-test device with the same/old size..

What to do/try next?

-- Pasi

#7 lore raw
Quoted 49 lines · Pasi Kärkkäinen
Quoted 31 lines · Pasi Kärkkäinen
Quoted 13 lines · Benjamin Marzinski
Quoted 9 lines

Responding to my own mail, I did got the source with the patches from the cvs. But, the resizing does not work for with with mounted volumes. There are 4 paths for the volume, so there is no probably with it failing paths. I get "domap(0) failure for create/reload map" when I run multipath -v 3.

I can get dm to reconize the new size if the volume is umounted. But, I really would like it to work while it is mounted.

It should work for mounted volumes. Did you try
multipathd -k"resize map <mapname>"

Quoted 9 lines

Since this requires suspending without the no_flush option, I didn't want to have it happen on a normal reload, and since without the kernel fixes, this required removing and then readding paths, I did it through multipathd.

So just running multipath -v3 after a path resize won't work. In fact, I think it might leave the devices in the suspended state, since the resume fails.

Hi!

I just tried this but I'm having problems getting it to work..

# multipathd -k"resize map mpath-resize-test"
fail
Quoted 9 lines

The underlying SCSI devices have been online resized already, and verified from dmesg and from /proc/partitions to be bigger.

I'm running rhel5 kernel with scsi online resize patches (2.6.18-93.el5.bz444964.2) and dm-multipath testing packages with support for online resizing (device-mapper-multipath-0.4.7-19.el5.i386.rpm).

Any ideas?

Actually I think the problem was that I had not yet reloaded multipathd configuration, so my underlying devices were still blacklisted according to multipathd -k"show devices".. but still I had the mpath-device up and running :) Oh well..

I ran "/etc/init.d/multipathd reload" and then:

Quoted 7 lines
# multipathd -k"resize map mpath-resize-test"
ok

But "multipath -ll" still shows the mpath-resize-test device with the same/old size..

What to do/try next?

Does

# blockdev --getsize <scsi_device>

show the new size, after you have increased the scsi device size?

Also, can you start up multipathd with the -v3 option, and copy any messages that are printed out when you run

# multipathd -k"resize map mpath-resize-test"

Thanks.

-Ben

Quoted 7 lines

-- Pasi

--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel

#8 lore raw
Quoted 56 lines · Benjamin Marzinski
Quoted 55 lines · Pasi Kärkkäinen
Quoted 31 lines · Pasi Kärkkäinen
Quoted 13 lines · Benjamin Marzinski
Quoted 9 lines

Responding to my own mail, I did got the source with the patches from the cvs. But, the resizing does not work for with with mounted volumes. There are 4 paths for the volume, so there is no probably with it failing paths. I get "domap(0) failure for create/reload map" when I run multipath -v 3.

I can get dm to reconize the new size if the volume is umounted. But, I really would like it to work while it is mounted.

It should work for mounted volumes. Did you try
multipathd -k"resize map <mapname>"

Quoted 9 lines

Since this requires suspending without the no_flush option, I didn't want to have it happen on a normal reload, and since without the kernel fixes, this required removing and then readding paths, I did it through multipathd.

So just running multipath -v3 after a path resize won't work. In fact, I think it might leave the devices in the suspended state, since the resume fails.

Hi!

I just tried this but I'm having problems getting it to work..

# multipathd -k"resize map mpath-resize-test"
fail
Quoted 9 lines

The underlying SCSI devices have been online resized already, and verified from dmesg and from /proc/partitions to be bigger.

I'm running rhel5 kernel with scsi online resize patches (2.6.18-93.el5.bz444964.2) and dm-multipath testing packages with support for online resizing (device-mapper-multipath-0.4.7-19.el5.i386.rpm).

Any ideas?

Actually I think the problem was that I had not yet reloaded multipathd configuration, so my underlying devices were still blacklisted according to multipathd -k"show devices".. but still I had the mpath-device up and running :) Oh well..

I ran "/etc/init.d/multipathd reload" and then:

# multipathd -k"resize map mpath-resize-test"
ok

But "multipath -ll" still shows the mpath-resize-test device with the same/old size..

Quoted 8 lines
Quoted 1 line

What to do/try next?

Does

# blockdev --getsize <scsi_device>

show the new size, after you have increased the scsi device size?

Yep, it does.

Quoted 7 lines

Also, can you start up multipathd with the -v3 option, and copy any messages that are printed out when you run

# multipathd -k"resize map mpath-resize-test"

Thanks.

I don't know what went wrong, but my mpath device went into SUSPENDED mode, and now also multipathd command just hangs.. actually I can't even reboot the server, 'reboot' command also hangs. "dmsetup resume" doesn't help..

I guess rebooting doesn't work because I have some IO waiting for execution for that suspended device/filesystem..

I power cycled the server, and tried again..

This time it worked OK!

Differences between my first try (which didn't work) and the second (successful) try:

- First time I didn't have multipathd restarted/reloaded to pick up the complete configuration for the LUNs/devices used in this test.

- First time I didn't understand to do 'del/add path' trick.. I went for 'resize map' immediately.

"Log" of my successful resize experience is here:
http://pasik.reaktio.net/rhel5-online-iscsi-resize-test.txt

Thanks a lot for your help!

-- Pasi

#9 lore raw
In reply to [email protected]
Quoted 20 lines · On Fri, Sep 19, 2008 at 03:27:10AM -0000, [email protected] wrote:

CVSROOT: /cvs/dm
Module name: multipath-tools
Branch: RHEL5_FC6
Changes by: [email protected] 2008-09-19 03:27:08

Modified files:
libmultipath : configure.c configure.h devmapper.c devmapper.h
multipathd : cli.c cli.h cli_handlers.c cli_handlers.h
main.c main.h

Log message:
Fix for bz #455692. There is now a command for multipathd, 'resize map'. This does online grows or shrinks for your multipath device. It has some warts.

1. It needs to remove and re-add every path in the device. This can cause two annoyances. First, if you only have one valid path, you go into an all paths down scenario. However, you will immediately re-add the path, so it won't trigger problem #2. Second, if the path is inaccessable, you may not be able to re-add it.

Quoted 8 lines

2. You can't disable flushing on suspend for a device-mapper device, when you want to change size. This means that if all your paths are down, you will fail the queued IOs when you suspend. This is a problem with the device-mapper kernel code, and there's no real way to avoid it, except by fixing it in the kernel.

This commit also has some minor fixups for 238421, and adds the ability to disable and restore queueing on all multipath devices through multipathd

Benjamin,

I was wondering if you were planning to re-submit this patch to upstream git tree? I tried to apply it and got:

patching file libmultipath/configure.c
Hunk #1 FAILED at 360.
1 out of 1 hunk FAILED -- saving rejects to file libmultipath/configure.c.rej patching file libmultipath/configure.h
patching file libmultipath/devmapper.c
Hunk #1 succeeded at 150 (offset 20 lines).
Hunk #2 FAILED at 162.
Hunk #3 succeeded at 517 with fuzz 2 (offset 42 lines).
Hunk #4 succeeded at 894 (offset 10 lines).
1 out of 4 hunks FAILED -- saving rejects to file libmultipath/devmapper.c.rej patching file libmultipath/devmapper.h
Hunk #1 FAILED at 4.
1 out of 1 hunk FAILED -- saving rejects to file libmultipath/devmapper.h.rej patching file multipathd/cli.c
Hunk #1 FAILED at 131.
1 out of 1 hunk FAILED -- saving rejects to file multipathd/cli.c.rej patching file multipathd/cli.h
Hunk #1 FAILED at 9.
Hunk #2 FAILED at 34.
2 out of 2 hunks FAILED -- saving rejects to file multipathd/cli.h.rej patching file multipathd/cli_handlers.c
Hunk #1 FAILED at 13.
Hunk #2 FAILED at 345.
Hunk #3 FAILED at 368.
Hunk #4 FAILED at 396.
Hunk #5 succeeded at 619 (offset 42 lines).
4 out of 6 hunks FAILED -- saving rejects to file multipathd/cli_handlers.c.rej patching file multipathd/cli_handlers.h
Hunk #1 FAILED at 14.
1 out of 1 hunk FAILED -- saving rejects to file multipathd/cli_handlers.h.rej patching file multipathd/main.c
Hunk #1 succeeded at 147 (offset -11 lines).
Hunk #2 FAILED at 757.
1 out of 2 hunks FAILED -- saving rejects to file multipathd/main.c.rej patching file multipathd/main.h
Hunk #1 succeeded at 9 with fuzz 2.

I haven't looked in detail on the rejects and tried to see if I can "jam" it in correctly.

#10 lore raw
Quoted 26 lines · Konrad Rzeszutek
Quoted 25 lines · On Fri, Sep 19, 2008 at 03:27:10AM -0000, [email protected] wrote:

CVSROOT: /cvs/dm
Module name: multipath-tools
Branch: RHEL5_FC6
Changes by: [email protected] 2008-09-19 03:27:08

Modified files:
libmultipath : configure.c configure.h devmapper.c devmapper.h
multipathd : cli.c cli.h cli_handlers.c cli_handlers.h
main.c main.h

Log message:
Fix for bz #455692. There is now a command for multipathd, 'resize map'. This does online grows or shrinks for your multipath device. It has some warts.

1. It needs to remove and re-add every path in the device. This can cause two annoyances. First, if you only have one valid path, you go into an all paths down scenario. However, you will immediately re-add the path, so it won't trigger problem #2. Second, if the path is inaccessable, you may not be able to re-add it.

2. You can't disable flushing on suspend for a device-mapper device, when you want to change size. This means that if all your paths are down, you will fail the queued IOs when you suspend. This is a problem with the device-mapper kernel code, and there's no real way to avoid it, except by fixing it in the kernel.

Quoted 8 lines
Quoted 3 lines

This commit also has some minor fixups for 238421, and adds the ability to disable and restore queueing on all multipath devices through multipathd

Benjamin,

I was wondering if you were planning to re-submit this patch to upstream git tree? I tried to apply it and got:

Yes. It's on my list that I'm slowly working through when I get time. Sorry. I'll try to get it out here quickly.

-Ben

Quoted 40 lines

patching file libmultipath/configure.c
Hunk #1 FAILED at 360.
1 out of 1 hunk FAILED -- saving rejects to file libmultipath/configure.c.rej patching file libmultipath/configure.h
patching file libmultipath/devmapper.c
Hunk #1 succeeded at 150 (offset 20 lines).
Hunk #2 FAILED at 162.
Hunk #3 succeeded at 517 with fuzz 2 (offset 42 lines).
Hunk #4 succeeded at 894 (offset 10 lines).
1 out of 4 hunks FAILED -- saving rejects to file libmultipath/devmapper.c.rej patching file libmultipath/devmapper.h
Hunk #1 FAILED at 4.
1 out of 1 hunk FAILED -- saving rejects to file libmultipath/devmapper.h.rej patching file multipathd/cli.c
Hunk #1 FAILED at 131.
1 out of 1 hunk FAILED -- saving rejects to file multipathd/cli.c.rej patching file multipathd/cli.h
Hunk #1 FAILED at 9.
Hunk #2 FAILED at 34.
2 out of 2 hunks FAILED -- saving rejects to file multipathd/cli.h.rej patching file multipathd/cli_handlers.c
Hunk #1 FAILED at 13.
Hunk #2 FAILED at 345.
Hunk #3 FAILED at 368.
Hunk #4 FAILED at 396.
Hunk #5 succeeded at 619 (offset 42 lines).
4 out of 6 hunks FAILED -- saving rejects to file multipathd/cli_handlers.c.rej patching file multipathd/cli_handlers.h
Hunk #1 FAILED at 14.
1 out of 1 hunk FAILED -- saving rejects to file multipathd/cli_handlers.h.rej patching file multipathd/main.c
Hunk #1 succeeded at 147 (offset -11 lines).
Hunk #2 FAILED at 757.
1 out of 2 hunks FAILED -- saving rejects to file multipathd/main.c.rej patching file multipathd/main.h
Hunk #1 succeeded at 9 with fuzz 2.

I haven't looked in detail on the rejects and tried to see if I can "jam" it in correctly.