Merge git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-2.6-dm
* git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-2.6-dm: dm: avoid destroying table in dm_any_congested dm: move pending queue wake_up end_io_acct dm mpath: warn if args ignored dm mpath: avoid attempting to activate null path dm stripe: fix init failure dm raid1: flush workqueue before destruction
This commit is contained in:
commit
7e5b95f1ba
4 changed files with 31 additions and 16 deletions
|
@ -441,13 +441,13 @@ static void process_queued_ios(struct work_struct *work)
|
||||||
__choose_pgpath(m);
|
__choose_pgpath(m);
|
||||||
|
|
||||||
pgpath = m->current_pgpath;
|
pgpath = m->current_pgpath;
|
||||||
m->pgpath_to_activate = m->current_pgpath;
|
|
||||||
|
|
||||||
if ((pgpath && !m->queue_io) ||
|
if ((pgpath && !m->queue_io) ||
|
||||||
(!pgpath && !m->queue_if_no_path))
|
(!pgpath && !m->queue_if_no_path))
|
||||||
must_queue = 0;
|
must_queue = 0;
|
||||||
|
|
||||||
if (m->pg_init_required && !m->pg_init_in_progress) {
|
if (m->pg_init_required && !m->pg_init_in_progress && pgpath) {
|
||||||
|
m->pgpath_to_activate = pgpath;
|
||||||
m->pg_init_count++;
|
m->pg_init_count++;
|
||||||
m->pg_init_required = 0;
|
m->pg_init_required = 0;
|
||||||
m->pg_init_in_progress = 1;
|
m->pg_init_in_progress = 1;
|
||||||
|
@ -708,6 +708,10 @@ static int parse_hw_handler(struct arg_set *as, struct multipath *m)
|
||||||
m->hw_handler_name = NULL;
|
m->hw_handler_name = NULL;
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (hw_argc > 1)
|
||||||
|
DMWARN("Ignoring user-specified arguments for "
|
||||||
|
"hardware handler \"%s\"", m->hw_handler_name);
|
||||||
consume(as, hw_argc - 1);
|
consume(as, hw_argc - 1);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -1032,6 +1032,7 @@ static void mirror_dtr(struct dm_target *ti)
|
||||||
|
|
||||||
del_timer_sync(&ms->timer);
|
del_timer_sync(&ms->timer);
|
||||||
flush_workqueue(ms->kmirrord_wq);
|
flush_workqueue(ms->kmirrord_wq);
|
||||||
|
flush_scheduled_work();
|
||||||
dm_kcopyd_client_destroy(ms->kcopyd_client);
|
dm_kcopyd_client_destroy(ms->kcopyd_client);
|
||||||
destroy_workqueue(ms->kmirrord_wq);
|
destroy_workqueue(ms->kmirrord_wq);
|
||||||
free_context(ms, ti, ms->nr_mirrors);
|
free_context(ms, ti, ms->nr_mirrors);
|
||||||
|
|
|
@ -320,8 +320,10 @@ int __init dm_stripe_init(void)
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
r = dm_register_target(&stripe_target);
|
r = dm_register_target(&stripe_target);
|
||||||
if (r < 0)
|
if (r < 0) {
|
||||||
DMWARN("target registration failed");
|
DMWARN("target registration failed");
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
kstriped = create_singlethread_workqueue("kstriped");
|
kstriped = create_singlethread_workqueue("kstriped");
|
||||||
if (!kstriped) {
|
if (!kstriped) {
|
||||||
|
|
|
@ -375,7 +375,7 @@ static void start_io_acct(struct dm_io *io)
|
||||||
dm_disk(md)->part0.in_flight = atomic_inc_return(&md->pending);
|
dm_disk(md)->part0.in_flight = atomic_inc_return(&md->pending);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int end_io_acct(struct dm_io *io)
|
static void end_io_acct(struct dm_io *io)
|
||||||
{
|
{
|
||||||
struct mapped_device *md = io->md;
|
struct mapped_device *md = io->md;
|
||||||
struct bio *bio = io->bio;
|
struct bio *bio = io->bio;
|
||||||
|
@ -391,7 +391,9 @@ static int end_io_acct(struct dm_io *io)
|
||||||
dm_disk(md)->part0.in_flight = pending =
|
dm_disk(md)->part0.in_flight = pending =
|
||||||
atomic_dec_return(&md->pending);
|
atomic_dec_return(&md->pending);
|
||||||
|
|
||||||
return !pending;
|
/* nudge anyone waiting on suspend queue */
|
||||||
|
if (!pending)
|
||||||
|
wake_up(&md->wait);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -499,9 +501,7 @@ static void dec_pending(struct dm_io *io, int error)
|
||||||
spin_unlock_irqrestore(&io->md->pushback_lock, flags);
|
spin_unlock_irqrestore(&io->md->pushback_lock, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (end_io_acct(io))
|
end_io_acct(io);
|
||||||
/* nudge anyone waiting on suspend queue */
|
|
||||||
wake_up(&io->md->wait);
|
|
||||||
|
|
||||||
if (io->error != DM_ENDIO_REQUEUE) {
|
if (io->error != DM_ENDIO_REQUEUE) {
|
||||||
blk_add_trace_bio(io->md->queue, io->bio,
|
blk_add_trace_bio(io->md->queue, io->bio,
|
||||||
|
@ -937,16 +937,24 @@ static void dm_unplug_all(struct request_queue *q)
|
||||||
|
|
||||||
static int dm_any_congested(void *congested_data, int bdi_bits)
|
static int dm_any_congested(void *congested_data, int bdi_bits)
|
||||||
{
|
{
|
||||||
int r;
|
int r = bdi_bits;
|
||||||
struct mapped_device *md = (struct mapped_device *) congested_data;
|
struct mapped_device *md = congested_data;
|
||||||
struct dm_table *map = dm_get_table(md);
|
struct dm_table *map;
|
||||||
|
|
||||||
if (!map || test_bit(DMF_BLOCK_IO, &md->flags))
|
atomic_inc(&md->pending);
|
||||||
r = bdi_bits;
|
|
||||||
else
|
if (!test_bit(DMF_BLOCK_IO, &md->flags)) {
|
||||||
r = dm_table_any_congested(map, bdi_bits);
|
map = dm_get_table(md);
|
||||||
|
if (map) {
|
||||||
|
r = dm_table_any_congested(map, bdi_bits);
|
||||||
|
dm_table_put(map);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!atomic_dec_return(&md->pending))
|
||||||
|
/* nudge anyone waiting on suspend queue */
|
||||||
|
wake_up(&md->wait);
|
||||||
|
|
||||||
dm_table_put(map);
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue