diff options
author | David S. Miller <davem@davemloft.net> | 2010-10-21 08:43:05 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-10-21 08:43:05 -0700 |
commit | 2198a10b501fd4443430cb17e065a9e859cc58c9 (patch) | |
tree | 87f3781d293da0f8f8f61615905eb7bf62b7c128 /block | |
parent | 9941fb62762253774cc6177d0b9172ece5133fe1 (diff) | |
parent | db5a753bf198ef7a50e17d2ff358adf37efe8648 (diff) | |
download | linux-3.10-2198a10b501fd4443430cb17e065a9e859cc58c9.tar.gz linux-3.10-2198a10b501fd4443430cb17e065a9e859cc58c9.tar.bz2 linux-3.10-2198a10b501fd4443430cb17e065a9e859cc58c9.zip |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
net/core/dev.c
Diffstat (limited to 'block')
-rw-r--r-- | block/bsg.c | 2 | ||||
-rw-r--r-- | block/elevator.c | 12 |
2 files changed, 9 insertions, 5 deletions
diff --git a/block/bsg.c b/block/bsg.c index 82d58829ba5..0c00870553a 100644 --- a/block/bsg.c +++ b/block/bsg.c @@ -426,7 +426,7 @@ static int blk_complete_sgv4_hdr_rq(struct request *rq, struct sg_io_v4 *hdr, /* * fill in all the output members */ - hdr->device_status = status_byte(rq->errors); + hdr->device_status = rq->errors & 0xff; hdr->transport_status = host_byte(rq->errors); hdr->driver_status = driver_byte(rq->errors); hdr->info = 0; diff --git a/block/elevator.c b/block/elevator.c index 205b09a5bd9..4e11559aa2b 100644 --- a/block/elevator.c +++ b/block/elevator.c @@ -938,6 +938,7 @@ int elv_register_queue(struct request_queue *q) } } kobject_uevent(&e->kobj, KOBJ_ADD); + e->registered = 1; } return error; } @@ -947,6 +948,7 @@ static void __elv_unregister_queue(struct elevator_queue *e) { kobject_uevent(&e->kobj, KOBJ_REMOVE); kobject_del(&e->kobj); + e->registered = 0; } void elv_unregister_queue(struct request_queue *q) @@ -1042,11 +1044,13 @@ static int elevator_switch(struct request_queue *q, struct elevator_type *new_e) spin_unlock_irq(q->queue_lock); - __elv_unregister_queue(old_elevator); + if (old_elevator->registered) { + __elv_unregister_queue(old_elevator); - err = elv_register_queue(q); - if (err) - goto fail_register; + err = elv_register_queue(q); + if (err) + goto fail_register; + } /* * finally exit old elevator and turn off BYPASS. |