Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 314160 Details for
Bug 438761
LTC:5.4:201049:DM-MP SCSI Hardware Handlers
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
Do not remove Hardware Handler code
do_not_remove_dm_hardware_handler_stuff (text/plain), 5.40 KB, created by
IBM Bug Proxy
on 2008-08-13 00:51:33 UTC
(
hide
)
Description:
Do not remove Hardware Handler code
Filename:
MIME Type:
Creator:
IBM Bug Proxy
Created:
2008-08-13 00:51:33 UTC
Size:
5.40 KB
patch
obsolete
>Leave the hardware handler infrastructure for backward compatibility and >ABI reasons. > >Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com> >----- >Index: linux-2.6.18.ppc64/drivers/md/dm-mpath.c >=================================================================== >--- linux-2.6.18.ppc64.orig/drivers/md/dm-mpath.c >+++ linux-2.6.18.ppc64/drivers/md/dm-mpath.c >@@ -62,6 +62,7 @@ struct multipath { > > spinlock_t lock; > >+ struct hw_handler hw_handler; > const char *hw_handler_name; > unsigned nr_priority_groups; > struct list_head priority_groups; >@@ -201,12 +202,17 @@ static struct multipath *alloc_multipath > static void free_multipath(struct multipath *m) > { > struct priority_group *pg, *tmp; >+ struct hw_handler *hwh = &m->hw_handler; > > list_for_each_entry_safe(pg, tmp, &m->priority_groups, list) { > list_del(&pg->list); > free_priority_group(pg, m->ti); > } > >+ if (hwh->type) { >+ hwh->type->destroy(hwh); >+ dm_put_hw_handler(hwh->type); >+ } > kfree(m->hw_handler_name); > mempool_destroy(m->mpio_pool); > kfree(m); >@@ -219,10 +225,12 @@ static void free_multipath(struct multip > > static void __switch_pg(struct multipath *m, struct pgpath *pgpath) > { >+ struct hw_handler *hwh = &m->hw_handler; >+ > m->current_pg = pgpath->pg; > > /* Must we initialise the PG first, and queue I/O till it's ready? */ >- if (m->hw_handler_name) { >+ if ((hwh->type && hwh->type->pg_init) || m->hw_handler_name) { > m->pg_init_required = 1; > m->queue_io = 1; > } else { >@@ -402,6 +410,7 @@ static void dispatch_queued_ios(struct m > static void process_queued_ios(void *data) > { > struct multipath *m = (struct multipath *) data; >+ struct hw_handler *hwh = &m->hw_handler; > struct pgpath *pgpath = NULL; > unsigned init_required = 0, must_queue = 1; > unsigned long flags; >@@ -431,9 +440,15 @@ out: > spin_unlock_irqrestore(&m->lock, flags); > > if (init_required) { >- struct path *path = &pgpath->path; >- int ret = scsi_dh_activate(bdev_get_queue(path->dev->bdev)); >- pg_init_done(path, ret); >+ if (hwh->type) >+ hwh->type->pg_init(hwh, pgpath->pg->bypassed, >+ &pgpath->path); >+ else { >+ int ret; >+ struct path *path = &pgpath->path; >+ ret = scsi_dh_activate(bdev_get_queue(path->dev->bdev)); >+ pg_init_done(path, ret); >+ } > } > > if (!must_queue) >@@ -657,13 +672,16 @@ static struct priority_group *parse_prio > static int parse_hw_handler(struct arg_set *as, struct multipath *m, > struct dm_target *ti) > { >+ int r; >+ struct hw_handler_type *hwht; > unsigned hw_argc; > > static struct param _params[] = { > {0, 1024, "invalid number of hardware handler args"}, > }; > >- if (read_param(_params, shift(as), &hw_argc, &ti->error)) >+ r = read_param(_params, shift(as), &hw_argc, &ti->error); >+ if (r) > return -EINVAL; > > if (!hw_argc) >@@ -671,16 +689,32 @@ static int parse_hw_handler(struct arg_s > > m->hw_handler_name = kstrdup(shift(as), GFP_KERNEL); > request_module("scsi_dh_%s", m->hw_handler_name); >- if (scsi_dh_handler_exist(m->hw_handler_name) == 0) { >- ti->error = "unknown hardware handler type"; >- kfree(m->hw_handler_name); >- m->hw_handler_name = NULL; >- return -EINVAL; >+ if (scsi_dh_handler_exist(m->hw_handler_name)) >+ goto done; >+ >+ hwht = dm_get_hw_handler(m->hw_handler_name); >+ if (!hwht) { >+ ti->error = "unknown hardware handler type"; >+ r = -EINVAL; >+ goto free_hw_handler_name; > } > >- consume(as, hw_argc - 1); >+ r = hwht->create(&m->hw_handler, hw_argc - 1, as->argv); >+ if (r) { >+ dm_put_hw_handler(hwht); >+ ti->error = "hardware handler constructor failed"; >+ goto free_hw_handler_name; >+ } >+ m->hw_handler.type = hwht; > >- return 0; >+free_hw_handler_name: >+ kfree(m->hw_handler_name); >+ m->hw_handler_name = NULL; >+ >+done: >+ consume(as, hw_argc - 1); >+ >+ return r; > } > > static int parse_features(struct arg_set *as, struct multipath *m, >@@ -1130,6 +1164,8 @@ static void pg_init_done(struct path *pa > static int do_end_io(struct multipath *m, struct bio *bio, > int error, struct mpath_io *mpio) > { >+ struct hw_handler *hwh = &m->hw_handler; >+ unsigned err_flags = MP_FAIL_PATH; /* Default behavior */ > unsigned long flags; > > if (!error) >@@ -1156,9 +1192,21 @@ static int do_end_io(struct multipath *m > } > spin_unlock_irqrestore(&m->lock, flags); > >- if (mpio->pgpath) >- fail_path(mpio->pgpath); >+ if (hwh->type && hwh->type->error) >+ err_flags = hwh->type->error(hwh, bio); > >+ if (mpio->pgpath) { >+ if (hwh->type) { >+ if (err_flags & MP_FAIL_PATH) >+ fail_path(mpio->pgpath); >+ >+ if (err_flags & MP_BYPASS_PG) >+ bypass_pg(m, mpio->pgpath->pg, 1); >+ } else >+ fail_path(mpio->pgpath); >+ } >+ if (hwh->type && (err_flags & MP_ERROR_IO)) >+ return -EIO; > requeue: > dm_bio_restore(&mpio->details, bio); > >@@ -1242,6 +1290,7 @@ static int multipath_status(struct dm_ta > int sz = 0; > unsigned long flags; > struct multipath *m = (struct multipath *) ti->private; >+ struct hw_handler *hwh = &m->hw_handler; > struct priority_group *pg; > struct pgpath *p; > unsigned pg_num; >@@ -1261,10 +1310,14 @@ static int multipath_status(struct dm_ta > DMEMIT("pg_init_retries %u ", m->pg_init_retries); > } > >- if (!m->hw_handler_name || type == STATUSTYPE_INFO) >+ if (hwh->type && hwh->type->status) >+ sz += hwh->type->status(hwh, type, result + sz, maxlen - sz); >+ >+ if ((!hwh->type && !m->hw_handler_name) || type == STATUSTYPE_INFO) > DMEMIT("0 "); > else >- DMEMIT("1 %s ", m->hw_handler_name); >+ DMEMIT("1 %s ", m->hw_handler_name ? m->hw_handler_name : >+ hwh->type->name); > > DMEMIT("%u ", m->nr_priority_groups); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 438761
:
314153
|
314154
|
314155
|
314156
|
314157
|
314158
|
314159
| 314160 |
314161
|
314162
|
314163
|
314339
|
314426
|
314828
|
314829
|
316641