2 * Copyright (C) 2003 Sistina Software Limited.
3 * Copyright (C) 2004-2005 Red Hat, Inc. All rights reserved.
5 * This file is released under the GPL.
8 #include <linux/device-mapper.h>
11 #include "dm-path-selector.h"
12 #include "dm-uevent.h"
14 #include <linux/ctype.h>
15 #include <linux/init.h>
16 #include <linux/mempool.h>
17 #include <linux/module.h>
18 #include <linux/pagemap.h>
19 #include <linux/slab.h>
20 #include <linux/time.h>
21 #include <linux/workqueue.h>
22 #include <linux/delay.h>
23 #include <scsi/scsi_dh.h>
24 #include <linux/atomic.h>
26 #define DM_MSG_PREFIX "multipath"
27 #define DM_PG_INIT_DELAY_MSECS 2000
28 #define DM_PG_INIT_DELAY_DEFAULT ((unsigned) -1)
32 struct list_head list
;
34 struct priority_group
*pg
; /* Owning PG */
35 unsigned is_active
; /* Path status */
36 unsigned fail_count
; /* Cumulative failure count */
39 struct delayed_work activate_path
;
42 #define path_to_pgpath(__pgp) container_of((__pgp), struct pgpath, path)
45 * Paths are grouped into Priority Groups and numbered from 1 upwards.
46 * Each has a path selector which controls which path gets used.
48 struct priority_group
{
49 struct list_head list
;
51 struct multipath
*m
; /* Owning multipath instance */
52 struct path_selector ps
;
54 unsigned pg_num
; /* Reference number */
55 unsigned bypassed
; /* Temporarily bypass this PG? */
57 unsigned nr_pgpaths
; /* Number of paths in PG */
58 struct list_head pgpaths
;
61 /* Multipath context */
63 struct list_head list
;
66 const char *hw_handler_name
;
67 char *hw_handler_params
;
71 unsigned nr_priority_groups
;
72 struct list_head priority_groups
;
74 wait_queue_head_t pg_init_wait
; /* Wait for pg_init completion */
76 unsigned pg_init_required
; /* pg_init needs calling? */
77 unsigned pg_init_in_progress
; /* Only one pg_init allowed at once */
78 unsigned pg_init_delay_retry
; /* Delay pg_init retry? */
80 unsigned nr_valid_paths
; /* Total number of usable paths */
81 struct pgpath
*current_pgpath
;
82 struct priority_group
*current_pg
;
83 struct priority_group
*next_pg
; /* Switch to this PG if set */
84 unsigned repeat_count
; /* I/Os left before calling PS again */
86 unsigned queue_io
:1; /* Must we queue all I/O? */
87 unsigned queue_if_no_path
:1; /* Queue I/O if last path fails? */
88 unsigned saved_queue_if_no_path
:1; /* Saved state during suspension */
89 unsigned retain_attached_hw_handler
:1; /* If there's already a hw_handler present, don't change it. */
90 unsigned pg_init_disabled
:1; /* pg_init is not currently allowed */
92 unsigned pg_init_retries
; /* Number of times to retry pg_init */
93 unsigned pg_init_count
; /* Number of times pg_init called */
94 unsigned pg_init_delay_msecs
; /* Number of msecs before pg_init retry */
97 struct work_struct process_queued_ios
;
98 struct list_head queued_ios
;
100 struct work_struct trigger_event
;
103 * We must use a mempool of dm_mpath_io structs so that we
104 * can resubmit bios on error.
106 mempool_t
*mpio_pool
;
108 struct mutex work_mutex
;
112 * Context information attached to each bio we process.
115 struct pgpath
*pgpath
;
119 typedef int (*action_fn
) (struct pgpath
*pgpath
);
121 static struct kmem_cache
*_mpio_cache
;
123 static struct workqueue_struct
*kmultipathd
, *kmpath_handlerd
;
124 static void process_queued_ios(struct work_struct
*work
);
125 static void trigger_event(struct work_struct
*work
);
126 static void activate_path(struct work_struct
*work
);
129 /*-----------------------------------------------
130 * Allocation routines
131 *-----------------------------------------------*/
133 static struct pgpath
*alloc_pgpath(void)
135 struct pgpath
*pgpath
= kzalloc(sizeof(*pgpath
), GFP_KERNEL
);
138 pgpath
->is_active
= 1;
139 INIT_DELAYED_WORK(&pgpath
->activate_path
, activate_path
);
145 static void free_pgpath(struct pgpath
*pgpath
)
150 static struct priority_group
*alloc_priority_group(void)
152 struct priority_group
*pg
;
154 pg
= kzalloc(sizeof(*pg
), GFP_KERNEL
);
157 INIT_LIST_HEAD(&pg
->pgpaths
);
162 static void free_pgpaths(struct list_head
*pgpaths
, struct dm_target
*ti
)
164 struct pgpath
*pgpath
, *tmp
;
165 struct multipath
*m
= ti
->private;
167 list_for_each_entry_safe(pgpath
, tmp
, pgpaths
, list
) {
168 list_del(&pgpath
->list
);
169 if (m
->hw_handler_name
)
170 scsi_dh_detach(bdev_get_queue(pgpath
->path
.dev
->bdev
));
171 dm_put_device(ti
, pgpath
->path
.dev
);
176 static void free_priority_group(struct priority_group
*pg
,
177 struct dm_target
*ti
)
179 struct path_selector
*ps
= &pg
->ps
;
182 ps
->type
->destroy(ps
);
183 dm_put_path_selector(ps
->type
);
186 free_pgpaths(&pg
->pgpaths
, ti
);
190 static struct multipath
*alloc_multipath(struct dm_target
*ti
)
193 unsigned min_ios
= dm_get_reserved_rq_based_ios();
195 m
= kzalloc(sizeof(*m
), GFP_KERNEL
);
197 INIT_LIST_HEAD(&m
->priority_groups
);
198 INIT_LIST_HEAD(&m
->queued_ios
);
199 spin_lock_init(&m
->lock
);
201 m
->pg_init_delay_msecs
= DM_PG_INIT_DELAY_DEFAULT
;
202 INIT_WORK(&m
->process_queued_ios
, process_queued_ios
);
203 INIT_WORK(&m
->trigger_event
, trigger_event
);
204 init_waitqueue_head(&m
->pg_init_wait
);
205 mutex_init(&m
->work_mutex
);
206 m
->mpio_pool
= mempool_create_slab_pool(min_ios
, _mpio_cache
);
218 static void free_multipath(struct multipath
*m
)
220 struct priority_group
*pg
, *tmp
;
222 list_for_each_entry_safe(pg
, tmp
, &m
->priority_groups
, list
) {
224 free_priority_group(pg
, m
->ti
);
227 kfree(m
->hw_handler_name
);
228 kfree(m
->hw_handler_params
);
229 mempool_destroy(m
->mpio_pool
);
233 static int set_mapinfo(struct multipath
*m
, union map_info
*info
)
235 struct dm_mpath_io
*mpio
;
237 mpio
= mempool_alloc(m
->mpio_pool
, GFP_ATOMIC
);
241 memset(mpio
, 0, sizeof(*mpio
));
247 static void clear_mapinfo(struct multipath
*m
, union map_info
*info
)
249 struct dm_mpath_io
*mpio
= info
->ptr
;
252 mempool_free(mpio
, m
->mpio_pool
);
255 /*-----------------------------------------------
257 *-----------------------------------------------*/
259 static void __pg_init_all_paths(struct multipath
*m
)
261 struct pgpath
*pgpath
;
262 unsigned long pg_init_delay
= 0;
265 m
->pg_init_required
= 0;
266 if (m
->pg_init_delay_retry
)
267 pg_init_delay
= msecs_to_jiffies(m
->pg_init_delay_msecs
!= DM_PG_INIT_DELAY_DEFAULT
?
268 m
->pg_init_delay_msecs
: DM_PG_INIT_DELAY_MSECS
);
269 list_for_each_entry(pgpath
, &m
->current_pg
->pgpaths
, list
) {
270 /* Skip failed paths */
271 if (!pgpath
->is_active
)
273 if (queue_delayed_work(kmpath_handlerd
, &pgpath
->activate_path
,
275 m
->pg_init_in_progress
++;
279 static void __switch_pg(struct multipath
*m
, struct pgpath
*pgpath
)
281 m
->current_pg
= pgpath
->pg
;
283 /* Must we initialise the PG first, and queue I/O till it's ready? */
284 if (m
->hw_handler_name
) {
285 m
->pg_init_required
= 1;
288 m
->pg_init_required
= 0;
292 m
->pg_init_count
= 0;
295 static int __choose_path_in_pg(struct multipath
*m
, struct priority_group
*pg
,
298 struct dm_path
*path
;
300 path
= pg
->ps
.type
->select_path(&pg
->ps
, &m
->repeat_count
, nr_bytes
);
304 m
->current_pgpath
= path_to_pgpath(path
);
306 if (m
->current_pg
!= pg
)
307 __switch_pg(m
, m
->current_pgpath
);
312 static void __choose_pgpath(struct multipath
*m
, size_t nr_bytes
)
314 struct priority_group
*pg
;
315 unsigned bypassed
= 1;
317 if (!m
->nr_valid_paths
)
320 /* Were we instructed to switch PG? */
324 if (!__choose_path_in_pg(m
, pg
, nr_bytes
))
328 /* Don't change PG until it has no remaining paths */
329 if (m
->current_pg
&& !__choose_path_in_pg(m
, m
->current_pg
, nr_bytes
))
333 * Loop through priority groups until we find a valid path.
334 * First time we skip PGs marked 'bypassed'.
335 * Second time we only try the ones we skipped, but set
336 * pg_init_delay_retry so we do not hammer controllers.
339 list_for_each_entry(pg
, &m
->priority_groups
, list
) {
340 if (pg
->bypassed
== bypassed
)
342 if (!__choose_path_in_pg(m
, pg
, nr_bytes
)) {
344 m
->pg_init_delay_retry
= 1;
348 } while (bypassed
--);
351 m
->current_pgpath
= NULL
;
352 m
->current_pg
= NULL
;
356 * Check whether bios must be queued in the device-mapper core rather
357 * than here in the target.
359 * m->lock must be held on entry.
361 * If m->queue_if_no_path and m->saved_queue_if_no_path hold the
362 * same value then we are not between multipath_presuspend()
363 * and multipath_resume() calls and we have no need to check
364 * for the DMF_NOFLUSH_SUSPENDING flag.
366 static int __must_push_back(struct multipath
*m
)
368 return (m
->queue_if_no_path
!= m
->saved_queue_if_no_path
&&
369 dm_noflush_suspending(m
->ti
));
372 static int map_io(struct multipath
*m
, struct request
*clone
,
373 union map_info
*map_context
, unsigned was_queued
)
375 int r
= DM_MAPIO_REMAPPED
;
376 size_t nr_bytes
= blk_rq_bytes(clone
);
378 struct pgpath
*pgpath
;
379 struct block_device
*bdev
;
380 struct dm_mpath_io
*mpio
= map_context
->ptr
;
382 spin_lock_irqsave(&m
->lock
, flags
);
384 /* Do we need to select a new pgpath? */
385 if (!m
->current_pgpath
||
386 (!m
->queue_io
&& (m
->repeat_count
&& --m
->repeat_count
== 0)))
387 __choose_pgpath(m
, nr_bytes
);
389 pgpath
= m
->current_pgpath
;
394 if ((pgpath
&& m
->queue_io
) ||
395 (!pgpath
&& m
->queue_if_no_path
)) {
396 /* Queue for the daemon to resubmit */
397 list_add_tail(&clone
->queuelist
, &m
->queued_ios
);
399 if ((m
->pg_init_required
&& !m
->pg_init_in_progress
) ||
401 queue_work(kmultipathd
, &m
->process_queued_ios
);
403 r
= DM_MAPIO_SUBMITTED
;
405 bdev
= pgpath
->path
.dev
->bdev
;
406 clone
->q
= bdev_get_queue(bdev
);
407 clone
->rq_disk
= bdev
->bd_disk
;
408 } else if (__must_push_back(m
))
409 r
= DM_MAPIO_REQUEUE
;
411 r
= -EIO
; /* Failed */
413 mpio
->pgpath
= pgpath
;
414 mpio
->nr_bytes
= nr_bytes
;
416 if (r
== DM_MAPIO_REMAPPED
&& pgpath
->pg
->ps
.type
->start_io
)
417 pgpath
->pg
->ps
.type
->start_io(&pgpath
->pg
->ps
, &pgpath
->path
,
420 spin_unlock_irqrestore(&m
->lock
, flags
);
426 * If we run out of usable paths, should we queue I/O or error it?
428 static int queue_if_no_path(struct multipath
*m
, unsigned queue_if_no_path
,
429 unsigned save_old_value
)
433 spin_lock_irqsave(&m
->lock
, flags
);
436 m
->saved_queue_if_no_path
= m
->queue_if_no_path
;
438 m
->saved_queue_if_no_path
= queue_if_no_path
;
439 m
->queue_if_no_path
= queue_if_no_path
;
440 if (!m
->queue_if_no_path
&& m
->queue_size
)
441 queue_work(kmultipathd
, &m
->process_queued_ios
);
443 spin_unlock_irqrestore(&m
->lock
, flags
);
448 /*-----------------------------------------------------------------
449 * The multipath daemon is responsible for resubmitting queued ios.
450 *---------------------------------------------------------------*/
452 static void dispatch_queued_ios(struct multipath
*m
)
456 union map_info
*info
;
457 struct request
*clone
, *n
;
460 spin_lock_irqsave(&m
->lock
, flags
);
461 list_splice_init(&m
->queued_ios
, &cl
);
462 spin_unlock_irqrestore(&m
->lock
, flags
);
464 list_for_each_entry_safe(clone
, n
, &cl
, queuelist
) {
465 list_del_init(&clone
->queuelist
);
467 info
= dm_get_rq_mapinfo(clone
);
469 r
= map_io(m
, clone
, info
, 1);
471 clear_mapinfo(m
, info
);
472 dm_kill_unmapped_request(clone
, r
);
473 } else if (r
== DM_MAPIO_REMAPPED
)
474 dm_dispatch_request(clone
);
475 else if (r
== DM_MAPIO_REQUEUE
) {
476 clear_mapinfo(m
, info
);
477 dm_requeue_unmapped_request(clone
);
482 static void process_queued_ios(struct work_struct
*work
)
484 struct multipath
*m
=
485 container_of(work
, struct multipath
, process_queued_ios
);
486 struct pgpath
*pgpath
= NULL
;
487 unsigned must_queue
= 1;
490 spin_lock_irqsave(&m
->lock
, flags
);
492 if (!m
->current_pgpath
)
493 __choose_pgpath(m
, 0);
495 pgpath
= m
->current_pgpath
;
497 if ((pgpath
&& !m
->queue_io
) ||
498 (!pgpath
&& !m
->queue_if_no_path
))
501 if (m
->pg_init_required
&& !m
->pg_init_in_progress
&& pgpath
&&
502 !m
->pg_init_disabled
)
503 __pg_init_all_paths(m
);
505 spin_unlock_irqrestore(&m
->lock
, flags
);
507 dispatch_queued_ios(m
);
511 * An event is triggered whenever a path is taken out of use.
512 * Includes path failure and PG bypass.
514 static void trigger_event(struct work_struct
*work
)
516 struct multipath
*m
=
517 container_of(work
, struct multipath
, trigger_event
);
519 dm_table_event(m
->ti
->table
);
522 /*-----------------------------------------------------------------
523 * Constructor/argument parsing:
524 * <#multipath feature args> [<arg>]*
525 * <#hw_handler args> [hw_handler [<arg>]*]
527 * <initial priority group>
528 * [<selector> <#selector args> [<arg>]*
529 * <#paths> <#per-path selector args>
530 * [<path> [<arg>]* ]+ ]+
531 *---------------------------------------------------------------*/
532 static int parse_path_selector(struct dm_arg_set
*as
, struct priority_group
*pg
,
533 struct dm_target
*ti
)
536 struct path_selector_type
*pst
;
539 static struct dm_arg _args
[] = {
540 {0, 1024, "invalid number of path selector args"},
543 pst
= dm_get_path_selector(dm_shift_arg(as
));
545 ti
->error
= "unknown path selector type";
549 r
= dm_read_arg_group(_args
, as
, &ps_argc
, &ti
->error
);
551 dm_put_path_selector(pst
);
555 r
= pst
->create(&pg
->ps
, ps_argc
, as
->argv
);
557 dm_put_path_selector(pst
);
558 ti
->error
= "path selector constructor failed";
563 dm_consume_args(as
, ps_argc
);
568 static struct pgpath
*parse_path(struct dm_arg_set
*as
, struct path_selector
*ps
,
569 struct dm_target
*ti
)
573 struct multipath
*m
= ti
->private;
574 struct request_queue
*q
= NULL
;
575 const char *attached_handler_name
;
577 /* we need at least a path arg */
579 ti
->error
= "no device given";
580 return ERR_PTR(-EINVAL
);
585 return ERR_PTR(-ENOMEM
);
587 r
= dm_get_device(ti
, dm_shift_arg(as
), dm_table_get_mode(ti
->table
),
590 ti
->error
= "error getting device";
594 if (m
->retain_attached_hw_handler
|| m
->hw_handler_name
)
595 q
= bdev_get_queue(p
->path
.dev
->bdev
);
597 if (m
->retain_attached_hw_handler
) {
598 attached_handler_name
= scsi_dh_attached_handler_name(q
, GFP_KERNEL
);
599 if (attached_handler_name
) {
601 * Reset hw_handler_name to match the attached handler
602 * and clear any hw_handler_params associated with the
605 * NB. This modifies the table line to show the actual
606 * handler instead of the original table passed in.
608 kfree(m
->hw_handler_name
);
609 m
->hw_handler_name
= attached_handler_name
;
611 kfree(m
->hw_handler_params
);
612 m
->hw_handler_params
= NULL
;
616 if (m
->hw_handler_name
) {
618 * Increments scsi_dh reference, even when using an
619 * already-attached handler.
621 r
= scsi_dh_attach(q
, m
->hw_handler_name
);
624 * Already attached to different hw_handler:
625 * try to reattach with correct one.
628 r
= scsi_dh_attach(q
, m
->hw_handler_name
);
632 ti
->error
= "error attaching hardware handler";
633 dm_put_device(ti
, p
->path
.dev
);
637 if (m
->hw_handler_params
) {
638 r
= scsi_dh_set_params(q
, m
->hw_handler_params
);
640 ti
->error
= "unable to set hardware "
641 "handler parameters";
643 dm_put_device(ti
, p
->path
.dev
);
649 r
= ps
->type
->add_path(ps
, &p
->path
, as
->argc
, as
->argv
, &ti
->error
);
651 dm_put_device(ti
, p
->path
.dev
);
662 static struct priority_group
*parse_priority_group(struct dm_arg_set
*as
,
665 static struct dm_arg _args
[] = {
666 {1, 1024, "invalid number of paths"},
667 {0, 1024, "invalid number of selector args"}
671 unsigned i
, nr_selector_args
, nr_args
;
672 struct priority_group
*pg
;
673 struct dm_target
*ti
= m
->ti
;
677 ti
->error
= "not enough priority group arguments";
678 return ERR_PTR(-EINVAL
);
681 pg
= alloc_priority_group();
683 ti
->error
= "couldn't allocate priority group";
684 return ERR_PTR(-ENOMEM
);
688 r
= parse_path_selector(as
, pg
, ti
);
695 r
= dm_read_arg(_args
, as
, &pg
->nr_pgpaths
, &ti
->error
);
699 r
= dm_read_arg(_args
+ 1, as
, &nr_selector_args
, &ti
->error
);
703 nr_args
= 1 + nr_selector_args
;
704 for (i
= 0; i
< pg
->nr_pgpaths
; i
++) {
705 struct pgpath
*pgpath
;
706 struct dm_arg_set path_args
;
708 if (as
->argc
< nr_args
) {
709 ti
->error
= "not enough path parameters";
714 path_args
.argc
= nr_args
;
715 path_args
.argv
= as
->argv
;
717 pgpath
= parse_path(&path_args
, &pg
->ps
, ti
);
718 if (IS_ERR(pgpath
)) {
724 list_add_tail(&pgpath
->list
, &pg
->pgpaths
);
725 dm_consume_args(as
, nr_args
);
731 free_priority_group(pg
, ti
);
735 static int parse_hw_handler(struct dm_arg_set
*as
, struct multipath
*m
)
739 struct dm_target
*ti
= m
->ti
;
741 static struct dm_arg _args
[] = {
742 {0, 1024, "invalid number of hardware handler args"},
745 if (dm_read_arg_group(_args
, as
, &hw_argc
, &ti
->error
))
751 m
->hw_handler_name
= kstrdup(dm_shift_arg(as
), GFP_KERNEL
);
752 if (!try_then_request_module(scsi_dh_handler_exist(m
->hw_handler_name
),
753 "scsi_dh_%s", m
->hw_handler_name
)) {
754 ti
->error
= "unknown hardware handler type";
763 for (i
= 0; i
<= hw_argc
- 2; i
++)
764 len
+= strlen(as
->argv
[i
]) + 1;
765 p
= m
->hw_handler_params
= kzalloc(len
, GFP_KERNEL
);
767 ti
->error
= "memory allocation failed";
771 j
= sprintf(p
, "%d", hw_argc
- 1);
772 for (i
= 0, p
+=j
+1; i
<= hw_argc
- 2; i
++, p
+=j
+1)
773 j
= sprintf(p
, "%s", as
->argv
[i
]);
775 dm_consume_args(as
, hw_argc
- 1);
779 kfree(m
->hw_handler_name
);
780 m
->hw_handler_name
= NULL
;
784 static int parse_features(struct dm_arg_set
*as
, struct multipath
*m
)
788 struct dm_target
*ti
= m
->ti
;
789 const char *arg_name
;
791 static struct dm_arg _args
[] = {
792 {0, 6, "invalid number of feature args"},
793 {1, 50, "pg_init_retries must be between 1 and 50"},
794 {0, 60000, "pg_init_delay_msecs must be between 0 and 60000"},
797 r
= dm_read_arg_group(_args
, as
, &argc
, &ti
->error
);
805 arg_name
= dm_shift_arg(as
);
808 if (!strcasecmp(arg_name
, "queue_if_no_path")) {
809 r
= queue_if_no_path(m
, 1, 0);
813 if (!strcasecmp(arg_name
, "retain_attached_hw_handler")) {
814 m
->retain_attached_hw_handler
= 1;
818 if (!strcasecmp(arg_name
, "pg_init_retries") &&
820 r
= dm_read_arg(_args
+ 1, as
, &m
->pg_init_retries
, &ti
->error
);
825 if (!strcasecmp(arg_name
, "pg_init_delay_msecs") &&
827 r
= dm_read_arg(_args
+ 2, as
, &m
->pg_init_delay_msecs
, &ti
->error
);
832 ti
->error
= "Unrecognised multipath feature request";
834 } while (argc
&& !r
);
839 static int multipath_ctr(struct dm_target
*ti
, unsigned int argc
,
842 /* target arguments */
843 static struct dm_arg _args
[] = {
844 {0, 1024, "invalid number of priority groups"},
845 {0, 1024, "invalid initial priority group number"},
850 struct dm_arg_set as
;
851 unsigned pg_count
= 0;
852 unsigned next_pg_num
;
857 m
= alloc_multipath(ti
);
859 ti
->error
= "can't allocate multipath";
863 r
= parse_features(&as
, m
);
867 r
= parse_hw_handler(&as
, m
);
871 r
= dm_read_arg(_args
, &as
, &m
->nr_priority_groups
, &ti
->error
);
875 r
= dm_read_arg(_args
+ 1, &as
, &next_pg_num
, &ti
->error
);
879 if ((!m
->nr_priority_groups
&& next_pg_num
) ||
880 (m
->nr_priority_groups
&& !next_pg_num
)) {
881 ti
->error
= "invalid initial priority group";
886 /* parse the priority groups */
888 struct priority_group
*pg
;
890 pg
= parse_priority_group(&as
, m
);
896 m
->nr_valid_paths
+= pg
->nr_pgpaths
;
897 list_add_tail(&pg
->list
, &m
->priority_groups
);
899 pg
->pg_num
= pg_count
;
904 if (pg_count
!= m
->nr_priority_groups
) {
905 ti
->error
= "priority group count mismatch";
910 ti
->num_flush_bios
= 1;
911 ti
->num_discard_bios
= 1;
912 ti
->num_write_same_bios
= 1;
921 static void multipath_wait_for_pg_init_completion(struct multipath
*m
)
923 DECLARE_WAITQUEUE(wait
, current
);
926 add_wait_queue(&m
->pg_init_wait
, &wait
);
929 set_current_state(TASK_UNINTERRUPTIBLE
);
931 spin_lock_irqsave(&m
->lock
, flags
);
932 if (!m
->pg_init_in_progress
) {
933 spin_unlock_irqrestore(&m
->lock
, flags
);
936 spin_unlock_irqrestore(&m
->lock
, flags
);
940 set_current_state(TASK_RUNNING
);
942 remove_wait_queue(&m
->pg_init_wait
, &wait
);
945 static void flush_multipath_work(struct multipath
*m
)
949 spin_lock_irqsave(&m
->lock
, flags
);
950 m
->pg_init_disabled
= 1;
951 spin_unlock_irqrestore(&m
->lock
, flags
);
953 flush_workqueue(kmpath_handlerd
);
954 multipath_wait_for_pg_init_completion(m
);
955 flush_workqueue(kmultipathd
);
956 flush_work(&m
->trigger_event
);
958 spin_lock_irqsave(&m
->lock
, flags
);
959 m
->pg_init_disabled
= 0;
960 spin_unlock_irqrestore(&m
->lock
, flags
);
963 static void multipath_dtr(struct dm_target
*ti
)
965 struct multipath
*m
= ti
->private;
967 flush_multipath_work(m
);
972 * Map cloned requests
974 static int multipath_map(struct dm_target
*ti
, struct request
*clone
,
975 union map_info
*map_context
)
978 struct multipath
*m
= (struct multipath
*) ti
->private;
980 if (set_mapinfo(m
, map_context
) < 0)
981 /* ENOMEM, requeue */
982 return DM_MAPIO_REQUEUE
;
984 clone
->cmd_flags
|= REQ_FAILFAST_TRANSPORT
;
985 r
= map_io(m
, clone
, map_context
, 0);
986 if (r
< 0 || r
== DM_MAPIO_REQUEUE
)
987 clear_mapinfo(m
, map_context
);
993 * Take a path out of use.
995 static int fail_path(struct pgpath
*pgpath
)
998 struct multipath
*m
= pgpath
->pg
->m
;
1000 spin_lock_irqsave(&m
->lock
, flags
);
1002 if (!pgpath
->is_active
)
1005 DMWARN("Failing path %s.", pgpath
->path
.dev
->name
);
1007 pgpath
->pg
->ps
.type
->fail_path(&pgpath
->pg
->ps
, &pgpath
->path
);
1008 pgpath
->is_active
= 0;
1009 pgpath
->fail_count
++;
1011 m
->nr_valid_paths
--;
1013 if (pgpath
== m
->current_pgpath
)
1014 m
->current_pgpath
= NULL
;
1016 dm_path_uevent(DM_UEVENT_PATH_FAILED
, m
->ti
,
1017 pgpath
->path
.dev
->name
, m
->nr_valid_paths
);
1019 schedule_work(&m
->trigger_event
);
1022 spin_unlock_irqrestore(&m
->lock
, flags
);
1028 * Reinstate a previously-failed path
1030 static int reinstate_path(struct pgpath
*pgpath
)
1033 unsigned long flags
;
1034 struct multipath
*m
= pgpath
->pg
->m
;
1036 spin_lock_irqsave(&m
->lock
, flags
);
1038 if (pgpath
->is_active
)
1041 if (!pgpath
->pg
->ps
.type
->reinstate_path
) {
1042 DMWARN("Reinstate path not supported by path selector %s",
1043 pgpath
->pg
->ps
.type
->name
);
1048 r
= pgpath
->pg
->ps
.type
->reinstate_path(&pgpath
->pg
->ps
, &pgpath
->path
);
1052 pgpath
->is_active
= 1;
1054 if (!m
->nr_valid_paths
++ && m
->queue_size
) {
1055 m
->current_pgpath
= NULL
;
1056 queue_work(kmultipathd
, &m
->process_queued_ios
);
1057 } else if (m
->hw_handler_name
&& (m
->current_pg
== pgpath
->pg
)) {
1058 if (queue_work(kmpath_handlerd
, &pgpath
->activate_path
.work
))
1059 m
->pg_init_in_progress
++;
1062 dm_path_uevent(DM_UEVENT_PATH_REINSTATED
, m
->ti
,
1063 pgpath
->path
.dev
->name
, m
->nr_valid_paths
);
1065 schedule_work(&m
->trigger_event
);
1068 spin_unlock_irqrestore(&m
->lock
, flags
);
1074 * Fail or reinstate all paths that match the provided struct dm_dev.
1076 static int action_dev(struct multipath
*m
, struct dm_dev
*dev
,
1080 struct pgpath
*pgpath
;
1081 struct priority_group
*pg
;
1083 list_for_each_entry(pg
, &m
->priority_groups
, list
) {
1084 list_for_each_entry(pgpath
, &pg
->pgpaths
, list
) {
1085 if (pgpath
->path
.dev
== dev
)
1094 * Temporarily try to avoid having to use the specified PG
1096 static void bypass_pg(struct multipath
*m
, struct priority_group
*pg
,
1099 unsigned long flags
;
1101 spin_lock_irqsave(&m
->lock
, flags
);
1103 pg
->bypassed
= bypassed
;
1104 m
->current_pgpath
= NULL
;
1105 m
->current_pg
= NULL
;
1107 spin_unlock_irqrestore(&m
->lock
, flags
);
1109 schedule_work(&m
->trigger_event
);
1113 * Switch to using the specified PG from the next I/O that gets mapped
1115 static int switch_pg_num(struct multipath
*m
, const char *pgstr
)
1117 struct priority_group
*pg
;
1119 unsigned long flags
;
1122 if (!pgstr
|| (sscanf(pgstr
, "%u%c", &pgnum
, &dummy
) != 1) || !pgnum
||
1123 (pgnum
> m
->nr_priority_groups
)) {
1124 DMWARN("invalid PG number supplied to switch_pg_num");
1128 spin_lock_irqsave(&m
->lock
, flags
);
1129 list_for_each_entry(pg
, &m
->priority_groups
, list
) {
1134 m
->current_pgpath
= NULL
;
1135 m
->current_pg
= NULL
;
1138 spin_unlock_irqrestore(&m
->lock
, flags
);
1140 schedule_work(&m
->trigger_event
);
1145 * Set/clear bypassed status of a PG.
1146 * PGs are numbered upwards from 1 in the order they were declared.
1148 static int bypass_pg_num(struct multipath
*m
, const char *pgstr
, int bypassed
)
1150 struct priority_group
*pg
;
1154 if (!pgstr
|| (sscanf(pgstr
, "%u%c", &pgnum
, &dummy
) != 1) || !pgnum
||
1155 (pgnum
> m
->nr_priority_groups
)) {
1156 DMWARN("invalid PG number supplied to bypass_pg");
1160 list_for_each_entry(pg
, &m
->priority_groups
, list
) {
1165 bypass_pg(m
, pg
, bypassed
);
1170 * Should we retry pg_init immediately?
1172 static int pg_init_limit_reached(struct multipath
*m
, struct pgpath
*pgpath
)
1174 unsigned long flags
;
1175 int limit_reached
= 0;
1177 spin_lock_irqsave(&m
->lock
, flags
);
1179 if (m
->pg_init_count
<= m
->pg_init_retries
&& !m
->pg_init_disabled
)
1180 m
->pg_init_required
= 1;
1184 spin_unlock_irqrestore(&m
->lock
, flags
);
1186 return limit_reached
;
1189 static void pg_init_done(void *data
, int errors
)
1191 struct pgpath
*pgpath
= data
;
1192 struct priority_group
*pg
= pgpath
->pg
;
1193 struct multipath
*m
= pg
->m
;
1194 unsigned long flags
;
1195 unsigned delay_retry
= 0;
1197 /* device or driver problems */
1202 if (!m
->hw_handler_name
) {
1206 DMERR("Could not failover the device: Handler scsi_dh_%s "
1207 "Error %d.", m
->hw_handler_name
, errors
);
1209 * Fail path for now, so we do not ping pong
1213 case SCSI_DH_DEV_TEMP_BUSY
:
1215 * Probably doing something like FW upgrade on the
1216 * controller so try the other pg.
1218 bypass_pg(m
, pg
, 1);
1221 /* Wait before retrying. */
1223 case SCSI_DH_IMM_RETRY
:
1224 case SCSI_DH_RES_TEMP_UNAVAIL
:
1225 if (pg_init_limit_reached(m
, pgpath
))
1231 * We probably do not want to fail the path for a device
1232 * error, but this is what the old dm did. In future
1233 * patches we can do more advanced handling.
1238 spin_lock_irqsave(&m
->lock
, flags
);
1240 if (pgpath
== m
->current_pgpath
) {
1241 DMERR("Could not failover device. Error %d.", errors
);
1242 m
->current_pgpath
= NULL
;
1243 m
->current_pg
= NULL
;
1245 } else if (!m
->pg_init_required
)
1248 if (--m
->pg_init_in_progress
)
1249 /* Activations of other paths are still on going */
1252 if (!m
->pg_init_required
)
1255 m
->pg_init_delay_retry
= delay_retry
;
1256 queue_work(kmultipathd
, &m
->process_queued_ios
);
1259 * Wake up any thread waiting to suspend.
1261 wake_up(&m
->pg_init_wait
);
1264 spin_unlock_irqrestore(&m
->lock
, flags
);
1267 static void activate_path(struct work_struct
*work
)
1269 struct pgpath
*pgpath
=
1270 container_of(work
, struct pgpath
, activate_path
.work
);
1272 scsi_dh_activate(bdev_get_queue(pgpath
->path
.dev
->bdev
),
1273 pg_init_done
, pgpath
);
1276 static int noretry_error(int error
)
1287 /* Anything else could be a path failure, so should be retried */
1294 static int do_end_io(struct multipath
*m
, struct request
*clone
,
1295 int error
, struct dm_mpath_io
*mpio
)
1298 * We don't queue any clone request inside the multipath target
1299 * during end I/O handling, since those clone requests don't have
1300 * bio clones. If we queue them inside the multipath target,
1301 * we need to make bio clones, that requires memory allocation.
1302 * (See drivers/md/dm.c:end_clone_bio() about why the clone requests
1303 * don't have bio clones.)
1304 * Instead of queueing the clone request here, we queue the original
1305 * request into dm core, which will remake a clone request and
1306 * clone bios for it and resubmit it later.
1308 int r
= DM_ENDIO_REQUEUE
;
1309 unsigned long flags
;
1311 if (!error
&& !clone
->errors
)
1312 return 0; /* I/O complete */
1314 if (noretry_error(error
)) {
1315 if ((clone
->cmd_flags
& REQ_WRITE_SAME
) &&
1316 !clone
->q
->limits
.max_write_same_sectors
) {
1317 struct queue_limits
*limits
;
1319 /* device doesn't really support WRITE SAME, disable it */
1320 limits
= dm_get_queue_limits(dm_table_get_md(m
->ti
->table
));
1321 limits
->max_write_same_sectors
= 0;
1327 fail_path(mpio
->pgpath
);
1329 spin_lock_irqsave(&m
->lock
, flags
);
1330 if (!m
->nr_valid_paths
) {
1331 if (!m
->queue_if_no_path
) {
1332 if (!__must_push_back(m
))
1335 if (error
== -EBADE
)
1339 spin_unlock_irqrestore(&m
->lock
, flags
);
1344 static int multipath_end_io(struct dm_target
*ti
, struct request
*clone
,
1345 int error
, union map_info
*map_context
)
1347 struct multipath
*m
= ti
->private;
1348 struct dm_mpath_io
*mpio
= map_context
->ptr
;
1349 struct pgpath
*pgpath
;
1350 struct path_selector
*ps
;
1355 r
= do_end_io(m
, clone
, error
, mpio
);
1356 pgpath
= mpio
->pgpath
;
1358 ps
= &pgpath
->pg
->ps
;
1359 if (ps
->type
->end_io
)
1360 ps
->type
->end_io(ps
, &pgpath
->path
, mpio
->nr_bytes
);
1362 clear_mapinfo(m
, map_context
);
1368 * Suspend can't complete until all the I/O is processed so if
1369 * the last path fails we must error any remaining I/O.
1370 * Note that if the freeze_bdev fails while suspending, the
1371 * queue_if_no_path state is lost - userspace should reset it.
1373 static void multipath_presuspend(struct dm_target
*ti
)
1375 struct multipath
*m
= (struct multipath
*) ti
->private;
1377 queue_if_no_path(m
, 0, 1);
1380 static void multipath_postsuspend(struct dm_target
*ti
)
1382 struct multipath
*m
= ti
->private;
1384 mutex_lock(&m
->work_mutex
);
1385 flush_multipath_work(m
);
1386 mutex_unlock(&m
->work_mutex
);
1390 * Restore the queue_if_no_path setting.
1392 static void multipath_resume(struct dm_target
*ti
)
1394 struct multipath
*m
= (struct multipath
*) ti
->private;
1395 unsigned long flags
;
1397 spin_lock_irqsave(&m
->lock
, flags
);
1398 m
->queue_if_no_path
= m
->saved_queue_if_no_path
;
1399 spin_unlock_irqrestore(&m
->lock
, flags
);
1403 * Info output has the following format:
1404 * num_multipath_feature_args [multipath_feature_args]*
1405 * num_handler_status_args [handler_status_args]*
1406 * num_groups init_group_number
1407 * [A|D|E num_ps_status_args [ps_status_args]*
1408 * num_paths num_selector_args
1409 * [path_dev A|F fail_count [selector_args]* ]+ ]+
1411 * Table output has the following format (identical to the constructor string):
1412 * num_feature_args [features_args]*
1413 * num_handler_args hw_handler [hw_handler_args]*
1414 * num_groups init_group_number
1415 * [priority selector-name num_ps_args [ps_args]*
1416 * num_paths num_selector_args [path_dev [selector_args]* ]+ ]+
1418 static void multipath_status(struct dm_target
*ti
, status_type_t type
,
1419 unsigned status_flags
, char *result
, unsigned maxlen
)
1422 unsigned long flags
;
1423 struct multipath
*m
= (struct multipath
*) ti
->private;
1424 struct priority_group
*pg
;
1429 spin_lock_irqsave(&m
->lock
, flags
);
1432 if (type
== STATUSTYPE_INFO
)
1433 DMEMIT("2 %u %u ", m
->queue_size
, m
->pg_init_count
);
1435 DMEMIT("%u ", m
->queue_if_no_path
+
1436 (m
->pg_init_retries
> 0) * 2 +
1437 (m
->pg_init_delay_msecs
!= DM_PG_INIT_DELAY_DEFAULT
) * 2 +
1438 m
->retain_attached_hw_handler
);
1439 if (m
->queue_if_no_path
)
1440 DMEMIT("queue_if_no_path ");
1441 if (m
->pg_init_retries
)
1442 DMEMIT("pg_init_retries %u ", m
->pg_init_retries
);
1443 if (m
->pg_init_delay_msecs
!= DM_PG_INIT_DELAY_DEFAULT
)
1444 DMEMIT("pg_init_delay_msecs %u ", m
->pg_init_delay_msecs
);
1445 if (m
->retain_attached_hw_handler
)
1446 DMEMIT("retain_attached_hw_handler ");
1449 if (!m
->hw_handler_name
|| type
== STATUSTYPE_INFO
)
1452 DMEMIT("1 %s ", m
->hw_handler_name
);
1454 DMEMIT("%u ", m
->nr_priority_groups
);
1457 pg_num
= m
->next_pg
->pg_num
;
1458 else if (m
->current_pg
)
1459 pg_num
= m
->current_pg
->pg_num
;
1461 pg_num
= (m
->nr_priority_groups
? 1 : 0);
1463 DMEMIT("%u ", pg_num
);
1466 case STATUSTYPE_INFO
:
1467 list_for_each_entry(pg
, &m
->priority_groups
, list
) {
1469 state
= 'D'; /* Disabled */
1470 else if (pg
== m
->current_pg
)
1471 state
= 'A'; /* Currently Active */
1473 state
= 'E'; /* Enabled */
1475 DMEMIT("%c ", state
);
1477 if (pg
->ps
.type
->status
)
1478 sz
+= pg
->ps
.type
->status(&pg
->ps
, NULL
, type
,
1484 DMEMIT("%u %u ", pg
->nr_pgpaths
,
1485 pg
->ps
.type
->info_args
);
1487 list_for_each_entry(p
, &pg
->pgpaths
, list
) {
1488 DMEMIT("%s %s %u ", p
->path
.dev
->name
,
1489 p
->is_active
? "A" : "F",
1491 if (pg
->ps
.type
->status
)
1492 sz
+= pg
->ps
.type
->status(&pg
->ps
,
1493 &p
->path
, type
, result
+ sz
,
1499 case STATUSTYPE_TABLE
:
1500 list_for_each_entry(pg
, &m
->priority_groups
, list
) {
1501 DMEMIT("%s ", pg
->ps
.type
->name
);
1503 if (pg
->ps
.type
->status
)
1504 sz
+= pg
->ps
.type
->status(&pg
->ps
, NULL
, type
,
1510 DMEMIT("%u %u ", pg
->nr_pgpaths
,
1511 pg
->ps
.type
->table_args
);
1513 list_for_each_entry(p
, &pg
->pgpaths
, list
) {
1514 DMEMIT("%s ", p
->path
.dev
->name
);
1515 if (pg
->ps
.type
->status
)
1516 sz
+= pg
->ps
.type
->status(&pg
->ps
,
1517 &p
->path
, type
, result
+ sz
,
1524 spin_unlock_irqrestore(&m
->lock
, flags
);
1527 static int multipath_message(struct dm_target
*ti
, unsigned argc
, char **argv
)
1531 struct multipath
*m
= (struct multipath
*) ti
->private;
1534 mutex_lock(&m
->work_mutex
);
1536 if (dm_suspended(ti
)) {
1542 if (!strcasecmp(argv
[0], "queue_if_no_path")) {
1543 r
= queue_if_no_path(m
, 1, 0);
1545 } else if (!strcasecmp(argv
[0], "fail_if_no_path")) {
1546 r
= queue_if_no_path(m
, 0, 0);
1552 DMWARN("Unrecognised multipath message received.");
1556 if (!strcasecmp(argv
[0], "disable_group")) {
1557 r
= bypass_pg_num(m
, argv
[1], 1);
1559 } else if (!strcasecmp(argv
[0], "enable_group")) {
1560 r
= bypass_pg_num(m
, argv
[1], 0);
1562 } else if (!strcasecmp(argv
[0], "switch_group")) {
1563 r
= switch_pg_num(m
, argv
[1]);
1565 } else if (!strcasecmp(argv
[0], "reinstate_path"))
1566 action
= reinstate_path
;
1567 else if (!strcasecmp(argv
[0], "fail_path"))
1570 DMWARN("Unrecognised multipath message received.");
1574 r
= dm_get_device(ti
, argv
[1], dm_table_get_mode(ti
->table
), &dev
);
1576 DMWARN("message: error getting device %s",
1581 r
= action_dev(m
, dev
, action
);
1583 dm_put_device(ti
, dev
);
1586 mutex_unlock(&m
->work_mutex
);
1590 static int multipath_ioctl(struct dm_target
*ti
, unsigned int cmd
,
1593 struct multipath
*m
= ti
->private;
1594 struct pgpath
*pgpath
;
1595 struct block_device
*bdev
;
1597 unsigned long flags
;
1604 spin_lock_irqsave(&m
->lock
, flags
);
1606 if (!m
->current_pgpath
)
1607 __choose_pgpath(m
, 0);
1609 pgpath
= m
->current_pgpath
;
1612 bdev
= pgpath
->path
.dev
->bdev
;
1613 mode
= pgpath
->path
.dev
->mode
;
1616 if ((pgpath
&& m
->queue_io
) || (!pgpath
&& m
->queue_if_no_path
))
1621 spin_unlock_irqrestore(&m
->lock
, flags
);
1624 * Only pass ioctls through if the device sizes match exactly.
1626 if (!bdev
|| ti
->len
!= i_size_read(bdev
->bd_inode
) >> SECTOR_SHIFT
) {
1627 int err
= scsi_verify_blk_ioctl(NULL
, cmd
);
1632 if (r
== -ENOTCONN
&& !fatal_signal_pending(current
))
1633 queue_work(kmultipathd
, &m
->process_queued_ios
);
1635 return r
? : __blkdev_driver_ioctl(bdev
, mode
, cmd
, arg
);
1638 static int multipath_iterate_devices(struct dm_target
*ti
,
1639 iterate_devices_callout_fn fn
, void *data
)
1641 struct multipath
*m
= ti
->private;
1642 struct priority_group
*pg
;
1646 list_for_each_entry(pg
, &m
->priority_groups
, list
) {
1647 list_for_each_entry(p
, &pg
->pgpaths
, list
) {
1648 ret
= fn(ti
, p
->path
.dev
, ti
->begin
, ti
->len
, data
);
1658 static int __pgpath_busy(struct pgpath
*pgpath
)
1660 struct request_queue
*q
= bdev_get_queue(pgpath
->path
.dev
->bdev
);
1662 return dm_underlying_device_busy(q
);
1666 * We return "busy", only when we can map I/Os but underlying devices
1667 * are busy (so even if we map I/Os now, the I/Os will wait on
1668 * the underlying queue).
1669 * In other words, if we want to kill I/Os or queue them inside us
1670 * due to map unavailability, we don't return "busy". Otherwise,
1671 * dm core won't give us the I/Os and we can't do what we want.
1673 static int multipath_busy(struct dm_target
*ti
)
1675 int busy
= 0, has_active
= 0;
1676 struct multipath
*m
= ti
->private;
1677 struct priority_group
*pg
;
1678 struct pgpath
*pgpath
;
1679 unsigned long flags
;
1681 spin_lock_irqsave(&m
->lock
, flags
);
1683 /* Guess which priority_group will be used at next mapping time */
1684 if (unlikely(!m
->current_pgpath
&& m
->next_pg
))
1686 else if (likely(m
->current_pg
))
1690 * We don't know which pg will be used at next mapping time.
1691 * We don't call __choose_pgpath() here to avoid to trigger
1692 * pg_init just by busy checking.
1693 * So we don't know whether underlying devices we will be using
1694 * at next mapping time are busy or not. Just try mapping.
1699 * If there is one non-busy active path at least, the path selector
1700 * will be able to select it. So we consider such a pg as not busy.
1703 list_for_each_entry(pgpath
, &pg
->pgpaths
, list
)
1704 if (pgpath
->is_active
) {
1707 if (!__pgpath_busy(pgpath
)) {
1715 * No active path in this pg, so this pg won't be used and
1716 * the current_pg will be changed at next mapping time.
1717 * We need to try mapping to determine it.
1722 spin_unlock_irqrestore(&m
->lock
, flags
);
1727 /*-----------------------------------------------------------------
1729 *---------------------------------------------------------------*/
1730 static struct target_type multipath_target
= {
1731 .name
= "multipath",
1732 .version
= {1, 6, 0},
1733 .module
= THIS_MODULE
,
1734 .ctr
= multipath_ctr
,
1735 .dtr
= multipath_dtr
,
1736 .map_rq
= multipath_map
,
1737 .rq_end_io
= multipath_end_io
,
1738 .presuspend
= multipath_presuspend
,
1739 .postsuspend
= multipath_postsuspend
,
1740 .resume
= multipath_resume
,
1741 .status
= multipath_status
,
1742 .message
= multipath_message
,
1743 .ioctl
= multipath_ioctl
,
1744 .iterate_devices
= multipath_iterate_devices
,
1745 .busy
= multipath_busy
,
1748 static int __init
dm_multipath_init(void)
1752 /* allocate a slab for the dm_ios */
1753 _mpio_cache
= KMEM_CACHE(dm_mpath_io
, 0);
1757 r
= dm_register_target(&multipath_target
);
1759 DMERR("register failed %d", r
);
1760 kmem_cache_destroy(_mpio_cache
);
1764 kmultipathd
= alloc_workqueue("kmpathd", WQ_MEM_RECLAIM
, 0);
1766 DMERR("failed to create workqueue kmpathd");
1767 dm_unregister_target(&multipath_target
);
1768 kmem_cache_destroy(_mpio_cache
);
1773 * A separate workqueue is used to handle the device handlers
1774 * to avoid overloading existing workqueue. Overloading the
1775 * old workqueue would also create a bottleneck in the
1776 * path of the storage hardware device activation.
1778 kmpath_handlerd
= alloc_ordered_workqueue("kmpath_handlerd",
1780 if (!kmpath_handlerd
) {
1781 DMERR("failed to create workqueue kmpath_handlerd");
1782 destroy_workqueue(kmultipathd
);
1783 dm_unregister_target(&multipath_target
);
1784 kmem_cache_destroy(_mpio_cache
);
1788 DMINFO("version %u.%u.%u loaded",
1789 multipath_target
.version
[0], multipath_target
.version
[1],
1790 multipath_target
.version
[2]);
1795 static void __exit
dm_multipath_exit(void)
1797 destroy_workqueue(kmpath_handlerd
);
1798 destroy_workqueue(kmultipathd
);
1800 dm_unregister_target(&multipath_target
);
1801 kmem_cache_destroy(_mpio_cache
);
1804 module_init(dm_multipath_init
);
1805 module_exit(dm_multipath_exit
);
1807 MODULE_DESCRIPTION(DM_NAME
" multipath target");
1808 MODULE_AUTHOR("Sistina Software <dm-devel@redhat.com>");
1809 MODULE_LICENSE("GPL");