mirror of
https://github.com/torvalds/linux.git
synced 2024-11-07 12:41:55 +00:00
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
@ -441,13 +441,13 @@ static void process_queued_ios(struct work_struct *work)
|
||||
__choose_pgpath(m);
|
||||
|
||||
pgpath = m->current_pgpath;
|
||||
m->pgpath_to_activate = m->current_pgpath;
|
||||
|
||||
if ((pgpath && !m->queue_io) ||
|
||||
(!pgpath && !m->queue_if_no_path))
|
||||
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_required = 0;
|
||||
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;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (hw_argc > 1)
|
||||
DMWARN("Ignoring user-specified arguments for "
|
||||
"hardware handler \"%s\"", m->hw_handler_name);
|
||||
consume(as, hw_argc - 1);
|
||||
|
||||
return 0;
|
||||
|
@ -1032,6 +1032,7 @@ static void mirror_dtr(struct dm_target *ti)
|
||||
|
||||
del_timer_sync(&ms->timer);
|
||||
flush_workqueue(ms->kmirrord_wq);
|
||||
flush_scheduled_work();
|
||||
dm_kcopyd_client_destroy(ms->kcopyd_client);
|
||||
destroy_workqueue(ms->kmirrord_wq);
|
||||
free_context(ms, ti, ms->nr_mirrors);
|
||||
|
@ -320,8 +320,10 @@ int __init dm_stripe_init(void)
|
||||
int r;
|
||||
|
||||
r = dm_register_target(&stripe_target);
|
||||
if (r < 0)
|
||||
if (r < 0) {
|
||||
DMWARN("target registration failed");
|
||||
return r;
|
||||
}
|
||||
|
||||
kstriped = create_singlethread_workqueue("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);
|
||||
}
|
||||
|
||||
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 bio *bio = io->bio;
|
||||
@ -391,7 +391,9 @@ static int end_io_acct(struct dm_io *io)
|
||||
dm_disk(md)->part0.in_flight = 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);
|
||||
}
|
||||
|
||||
if (end_io_acct(io))
|
||||
/* nudge anyone waiting on suspend queue */
|
||||
wake_up(&io->md->wait);
|
||||
end_io_acct(io);
|
||||
|
||||
if (io->error != DM_ENDIO_REQUEUE) {
|
||||
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)
|
||||
{
|
||||
int r;
|
||||
struct mapped_device *md = (struct mapped_device *) congested_data;
|
||||
struct dm_table *map = dm_get_table(md);
|
||||
int r = bdi_bits;
|
||||
struct mapped_device *md = congested_data;
|
||||
struct dm_table *map;
|
||||
|
||||
if (!map || test_bit(DMF_BLOCK_IO, &md->flags))
|
||||
r = bdi_bits;
|
||||
else
|
||||
r = dm_table_any_congested(map, bdi_bits);
|
||||
atomic_inc(&md->pending);
|
||||
|
||||
if (!test_bit(DMF_BLOCK_IO, &md->flags)) {
|
||||
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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user