diff options
author | Christophe Varoqui <christophe.varoqui@free.fr> | 2008-05-20 00:07:45 +0200 |
---|---|---|
committer | Christophe Varoqui <christophe.varoqui@free.fr> | 2008-05-21 22:01:17 +0200 |
commit | a4d0b34e841aae7e0722ba532ca46ff78b0f106e (patch) | |
tree | 99b2e228bed49d7bc36e0f275c5975ce06c0898c /multipath | |
parent | db06d678fedfcefcf202b14b9aec0c06a99ee1bc (diff) | |
download | multipath-tools-a4d0b34e841aae7e0722ba532ca46ff78b0f106e.tar.gz multipath-tools-a4d0b34e841aae7e0722ba532ca46ff78b0f106e.tar.bz2 multipath-tools-a4d0b34e841aae7e0722ba532ca46ff78b0f106e.zip |
add '-r' option to force devmap reload
This takes care of updating the write-protection flag
of the devmap in case the write-prot of the underlying
paths has changed (and the kernel somehow has discovered
so).
Now a RO->RW change scenario for a multipathed device can
be treated with :
1/ echo 1 >/sys/block/XX/device/rescan on all paths to dev
2/ multipath -r dev
Which minimaly fulfills my needs with Symmetrix SRDF spliting
in interim of more collaboration from other subsystems.
Diffstat (limited to 'multipath')
-rw-r--r-- | multipath/main.c | 66 |
1 files changed, 37 insertions, 29 deletions
diff --git a/multipath/main.c b/multipath/main.c index f1ac256..44c6bf6 100644 --- a/multipath/main.c +++ b/multipath/main.c @@ -75,34 +75,39 @@ static void usage (char * progname) { fprintf (stderr, VERSION_STRING); - fprintf (stderr, "Usage: %s\t[-v level] [-d] [-h|-l|-ll|-f|-F]\n", - progname); + fprintf (stderr, "Usage:\n"); + fprintf (stderr, " %s [-d] [-r] [-v lvl] [-p pol] [-b fil] [dev]\n", progname); + fprintf (stderr, " %s -l|-ll|-f [-v lvl] [-b fil] [dev]\n", progname); + fprintf (stderr, " %s -F [-v lvl]\n", progname); + fprintf (stderr, " %s -h\n", progname); fprintf (stderr, - "\t\t\t[-p failover|multibus|group_by_serial|group_by_prio]\n" \ - "\t\t\t[device]\n" \ - "\n" \ - "\t-v level\tverbosity level\n" \ - "\t 0\t\t\tno output\n" \ - "\t 1\t\t\tprint created devmap names only\n" \ - "\t 2\t\t\tdefault verbosity\n" \ - "\t 3\t\t\tprint debug information\n" \ - "\t-h\t\tprint this usage text\n" \ - "\t-b file\t\tbindings file location\n" \ - "\t-d\t\tdry run, do not create or update devmaps\n" \ - "\t-l\t\tshow multipath topology (sysfs and DM info)\n" \ - "\t-ll\t\tshow multipath topology (maximum info)\n" \ - "\t-f\t\tflush a multipath device map\n" \ - "\t-F\t\tflush all multipath device maps\n" \ - "\t-p policy\tforce all maps to specified policy :\n" \ - "\t failover\t\t1 path per priority group\n" \ - "\t multibus\t\tall paths in 1 priority group\n" \ - "\t group_by_serial\t1 priority group per serial\n" \ - "\t group_by_prio\t1 priority group per priority lvl\n" \ - "\t group_by_node_name\t1 priority group per target node\n" \ - "\n" \ - "\tdevice\t\tlimit scope to the device's multipath\n" \ - "\t\t\t(udev-style $DEVNAME reference, eg /dev/sdb\n" \ - "\t\t\tor major:minor or a device map name)\n" \ + "\n" + "Where:\n" + " -h print this usage text\n" \ + " -l show multipath topology (sysfs and DM info)\n" \ + " -ll show multipath topology (maximum info)\n" \ + " -f flush a multipath device map\n" \ + " -F flush all multipath device maps\n" \ + " -d dry run, do not create or update devmaps\n" \ + " -r force devmap reload\n" \ + " -p policy failover|multibus|group_by_serial|group_by_prio\n" \ + " -b fil bindings file location\n" \ + " -p pol force all maps to specified path grouping policy :\n" \ + " . failover one path per priority group\n" \ + " . multibus all paths in one priority group\n" \ + " . group_by_serial one priority group per serial\n" \ + " . group_by_prio one priority group per priority lvl\n" \ + " . group_by_node_name one priority group per target node\n" \ + " -v lvl verbosity level\n" \ + " . 0 no output\n" \ + " . 1 print created devmap names only\n" \ + " . 2 default verbosity\n" \ + " . 3 print debug information\n" \ + " dev action limited to:\n" \ + " . multipath named 'dev' (ex: mpath0) or\n" \ + " . multipath whose wwid is 'dev' (ex: 60051..)\n" \ + " . multipath including the path named 'dev' (ex: /dev/sda)\n" \ + " . multipath including the path with maj:min 'dev' (ex: 8:0)\n" \ ); exit(1); @@ -298,7 +303,7 @@ configure (void) /* * core logic entry point */ - r = coalesce_paths(&vecs, NULL, NULL); + r = coalesce_paths(&vecs, NULL, NULL, conf->force_reload); out: if (refwwid) @@ -341,7 +346,7 @@ main (int argc, char *argv[]) condlog(0, "multipath tools need sysfs mounted"); exit(1); } - while ((arg = getopt(argc, argv, ":dhl::FfM:v:p:b:")) != EOF ) { + while ((arg = getopt(argc, argv, ":dhl::FfM:v:p:b:r")) != EOF ) { switch(arg) { case 1: printf("optarg : %s\n",optarg); break; @@ -384,6 +389,9 @@ main (int argc, char *argv[]) usage(argv[0]); } break; + case 'r': + conf->force_reload = 1; + break; case 'h': usage(argv[0]); case ':': |