diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-08-01 12:06:47 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-08-01 12:06:47 -0400 |
| commit | eff0d13f3823f35d70228cd151d2a2c89288ff32 (patch) | |
| tree | 55bff4dbcc43c4b0f38509ac4de585c0c457980c | |
| parent | 8cf1a3fce0b95050b63d451c9d561da0da2aa4d6 (diff) | |
| parent | 10af8138eb6d09d6a768e43ef1aa9b2f16b8c7be (diff) | |
Merge branch 'for-3.6/drivers' of git://git.kernel.dk/linux-block
Pull block driver changes from Jens Axboe:
- Making the plugging support for drivers a bit more sane from Neil.
This supersedes the plugging change from Shaohua as well.
- The usual round of drbd updates.
- Using a tail add instead of a head add in the request completion for
ndb, making us find the most completed request more quickly.
- A few floppy changes, getting rid of a duplicated flag and also
running the floppy init async (since it takes forever in boot terms)
from Andi.
* 'for-3.6/drivers' of git://git.kernel.dk/linux-block:
floppy: remove duplicated flag FD_RAW_NEED_DISK
blk: pass from_schedule to non-request unplug functions.
block: stack unplug
blk: centralize non-request unplug handling.
md: remove plug_cnt feature of plugging.
block/nbd: micro-optimization in nbd request completion
drbd: announce FLUSH/FUA capability to upper layers
drbd: fix max_bio_size to be unsigned
drbd: flush drbd work queue before invalidate/invalidate remote
drbd: fix potential access after free
drbd: call local-io-error handler early
drbd: do not reset rs_pending_cnt too early
drbd: reset congestion information before reporting it in /proc/drbd
drbd: report congestion if we are waiting for some userland callback
drbd: differentiate between normal and forced detach
drbd: cleanup, remove two unused global flags
floppy: Run floppy initialization asynchronous
| -rw-r--r-- | block/blk-core.c | 44 | ||||
| -rw-r--r-- | drivers/block/drbd/drbd_actlog.c | 8 | ||||
| -rw-r--r-- | drivers/block/drbd/drbd_bitmap.c | 4 | ||||
| -rw-r--r-- | drivers/block/drbd/drbd_int.h | 44 | ||||
| -rw-r--r-- | drivers/block/drbd/drbd_main.c | 65 | ||||
| -rw-r--r-- | drivers/block/drbd/drbd_nl.c | 36 | ||||
| -rw-r--r-- | drivers/block/drbd/drbd_proc.c | 3 | ||||
| -rw-r--r-- | drivers/block/drbd/drbd_receiver.c | 38 | ||||
| -rw-r--r-- | drivers/block/drbd/drbd_req.c | 9 | ||||
| -rw-r--r-- | drivers/block/drbd/drbd_worker.c | 12 | ||||
| -rw-r--r-- | drivers/block/floppy.c | 24 | ||||
| -rw-r--r-- | drivers/block/nbd.c | 2 | ||||
| -rw-r--r-- | drivers/block/umem.c | 37 | ||||
| -rw-r--r-- | drivers/md/md.c | 59 | ||||
| -rw-r--r-- | drivers/md/md.h | 11 | ||||
| -rw-r--r-- | drivers/md/raid1.c | 3 | ||||
| -rw-r--r-- | drivers/md/raid10.c | 3 | ||||
| -rw-r--r-- | drivers/md/raid5.c | 5 | ||||
| -rw-r--r-- | include/linux/blkdev.h | 8 |
19 files changed, 238 insertions, 177 deletions
diff --git a/block/blk-core.c b/block/blk-core.c index dd134d834d58..4b4dbdfbca89 100644 --- a/block/blk-core.c +++ b/block/blk-core.c | |||
| @@ -2909,23 +2909,47 @@ static void queue_unplugged(struct request_queue *q, unsigned int depth, | |||
| 2909 | 2909 | ||
| 2910 | } | 2910 | } |
| 2911 | 2911 | ||
| 2912 | static void flush_plug_callbacks(struct blk_plug *plug) | 2912 | static void flush_plug_callbacks(struct blk_plug *plug, bool from_schedule) |
| 2913 | { | 2913 | { |
| 2914 | LIST_HEAD(callbacks); | 2914 | LIST_HEAD(callbacks); |
| 2915 | 2915 | ||
| 2916 | if (list_empty(&plug->cb_list)) | 2916 | while (!list_empty(&plug->cb_list)) { |
| 2917 | return; | 2917 | list_splice_init(&plug->cb_list, &callbacks); |
| 2918 | |||
| 2919 | list_splice_init(&plug->cb_list, &callbacks); | ||
| 2920 | 2918 | ||
| 2921 | while (!list_empty(&callbacks)) { | 2919 | while (!list_empty(&callbacks)) { |
| 2922 | struct blk_plug_cb *cb = list_first_entry(&callbacks, | 2920 | struct blk_plug_cb *cb = list_first_entry(&callbacks, |
| 2923 | struct blk_plug_cb, | 2921 | struct blk_plug_cb, |
| 2924 | list); | 2922 | list); |
| 2925 | list_del(&cb->list); | 2923 | list_del(&cb->list); |
| 2926 | cb->callback(cb); | 2924 | cb->callback(cb, from_schedule); |
| 2925 | } | ||
| 2926 | } | ||
| 2927 | } | ||
| 2928 | |||
| 2929 | struct blk_plug_cb *blk_check_plugged(blk_plug_cb_fn unplug, void *data, | ||
| 2930 | int size) | ||
| 2931 | { | ||
| 2932 | struct blk_plug *plug = current->plug; | ||
| 2933 | struct blk_plug_cb *cb; | ||
| 2934 | |||
| 2935 | if (!plug) | ||
| 2936 | return NULL; | ||
| 2937 | |||
| 2938 | list_for_each_entry(cb, &plug->cb_list, list) | ||
| 2939 | if (cb->callback == unplug && cb->data == data) | ||
| 2940 | return cb; | ||
| 2941 | |||
| 2942 | /* Not currently on the callback list */ | ||
| 2943 | BUG_ON(size < sizeof(*cb)); | ||
| 2944 | cb = kzalloc(size, GFP_ATOMIC); | ||
| 2945 | if (cb) { | ||
| 2946 | cb->data = data; | ||
| 2947 | cb->callback = unplug; | ||
| 2948 | list_add(&cb->list, &plug->cb_list); | ||
| 2927 | } | 2949 | } |
| 2950 | return cb; | ||
| 2928 | } | 2951 | } |
| 2952 | EXPORT_SYMBOL(blk_check_plugged); | ||
| 2929 | 2953 | ||
| 2930 | void blk_flush_plug_list(struct blk_plug *plug, bool from_schedule) | 2954 | void blk_flush_plug_list(struct blk_plug *plug, bool from_schedule) |
| 2931 | { | 2955 | { |
| @@ -2937,7 +2961,7 @@ void blk_flush_plug_list(struct blk_plug *plug, bool from_schedule) | |||
| 2937 | 2961 | ||
| 2938 | BUG_ON(plug->magic != PLUG_MAGIC); | 2962 | BUG_ON(plug->magic != PLUG_MAGIC); |
| 2939 | 2963 | ||
| 2940 | flush_plug_callbacks(plug); | 2964 | flush_plug_callbacks(plug, from_schedule); |
| 2941 | if (list_empty(&plug->list)) | 2965 | if (list_empty(&plug->list)) |
| 2942 | return; | 2966 | return; |
| 2943 | 2967 | ||
diff --git a/drivers/block/drbd/drbd_actlog.c b/drivers/block/drbd/drbd_actlog.c index e54e31b02b88..3fbef018ce55 100644 --- a/drivers/block/drbd/drbd_actlog.c +++ b/drivers/block/drbd/drbd_actlog.c | |||
| @@ -411,7 +411,7 @@ w_al_write_transaction(struct drbd_conf *mdev, struct drbd_work *w, int unused) | |||
| 411 | + mdev->ldev->md.al_offset + mdev->al_tr_pos; | 411 | + mdev->ldev->md.al_offset + mdev->al_tr_pos; |
| 412 | 412 | ||
| 413 | if (!drbd_md_sync_page_io(mdev, mdev->ldev, sector, WRITE)) | 413 | if (!drbd_md_sync_page_io(mdev, mdev->ldev, sector, WRITE)) |
| 414 | drbd_chk_io_error(mdev, 1, true); | 414 | drbd_chk_io_error(mdev, 1, DRBD_META_IO_ERROR); |
| 415 | 415 | ||
| 416 | if (++mdev->al_tr_pos > | 416 | if (++mdev->al_tr_pos > |
| 417 | div_ceil(mdev->act_log->nr_elements, AL_EXTENTS_PT)) | 417 | div_ceil(mdev->act_log->nr_elements, AL_EXTENTS_PT)) |
| @@ -876,7 +876,11 @@ int __drbd_set_out_of_sync(struct drbd_conf *mdev, sector_t sector, int size, | |||
| 876 | unsigned int enr, count = 0; | 876 | unsigned int enr, count = 0; |
| 877 | struct lc_element *e; | 877 | struct lc_element *e; |
| 878 | 878 | ||
| 879 | if (size <= 0 || (size & 0x1ff) != 0 || size > DRBD_MAX_BIO_SIZE) { | 879 | /* this should be an empty REQ_FLUSH */ |
| 880 | if (size == 0) | ||
| 881 | return 0; | ||
| 882 | |||
| 883 | if (size < 0 || (size & 0x1ff) != 0 || size > DRBD_MAX_BIO_SIZE) { | ||
| 880 | dev_err(DEV, "sector: %llus, size: %d\n", | 884 | dev_err(DEV, "sector: %llus, size: %d\n", |
| 881 | (unsigned long long)sector, size); | 885 | (unsigned long long)sector, size); |
| 882 | return 0; | 886 | return 0; |
diff --git a/drivers/block/drbd/drbd_bitmap.c b/drivers/block/drbd/drbd_bitmap.c index fcb956bb4b4c..ba91b408abad 100644 --- a/drivers/block/drbd/drbd_bitmap.c +++ b/drivers/block/drbd/drbd_bitmap.c | |||
| @@ -1096,7 +1096,7 @@ static int bm_rw(struct drbd_conf *mdev, int rw, unsigned flags, unsigned lazy_w | |||
| 1096 | 1096 | ||
| 1097 | if (ctx->error) { | 1097 | if (ctx->error) { |
| 1098 | dev_alert(DEV, "we had at least one MD IO ERROR during bitmap IO\n"); | 1098 | dev_alert(DEV, "we had at least one MD IO ERROR during bitmap IO\n"); |
| 1099 | drbd_chk_io_error(mdev, 1, true); | 1099 | drbd_chk_io_error(mdev, 1, DRBD_META_IO_ERROR); |
| 1100 | err = -EIO; /* ctx->error ? */ | 1100 | err = -EIO; /* ctx->error ? */ |
| 1101 | } | 1101 | } |
| 1102 | 1102 | ||
| @@ -1212,7 +1212,7 @@ int drbd_bm_write_page(struct drbd_conf *mdev, unsigned int idx) __must_hold(loc | |||
| 1212 | wait_until_done_or_disk_failure(mdev, mdev->ldev, &ctx->done); | 1212 | wait_until_done_or_disk_failure(mdev, mdev->ldev, &ctx->done); |
| 1213 | 1213 | ||
| 1214 | if (ctx->error) | 1214 | if (ctx->error) |
| 1215 | drbd_chk_io_error(mdev, 1, true); | 1215 | drbd_chk_io_error(mdev, 1, DRBD_META_IO_ERROR); |
| 1216 | /* that should force detach, so the in memory bitmap will be | 1216 | /* that should force detach, so the in memory bitmap will be |
| 1217 | * gone in a moment as well. */ | 1217 | * gone in a moment as well. */ |
| 1218 | 1218 | ||
diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h index 02f013a073a7..b2ca143d0053 100644 --- a/drivers/block/drbd/drbd_int.h +++ b/drivers/block/drbd/drbd_int.h | |||
| @@ -813,7 +813,6 @@ enum { | |||
| 813 | SIGNAL_ASENDER, /* whether asender wants to be interrupted */ | 813 | SIGNAL_ASENDER, /* whether asender wants to be interrupted */ |
| 814 | SEND_PING, /* whether asender should send a ping asap */ | 814 | SEND_PING, /* whether asender should send a ping asap */ |
| 815 | 815 | ||
| 816 | UNPLUG_QUEUED, /* only relevant with kernel 2.4 */ | ||
| 817 | UNPLUG_REMOTE, /* sending a "UnplugRemote" could help */ | 816 | UNPLUG_REMOTE, /* sending a "UnplugRemote" could help */ |
| 818 | MD_DIRTY, /* current uuids and flags not yet on disk */ | 817 | MD_DIRTY, /* current uuids and flags not yet on disk */ |
| 819 | DISCARD_CONCURRENT, /* Set on one node, cleared on the peer! */ | 818 | DISCARD_CONCURRENT, /* Set on one node, cleared on the peer! */ |
| @@ -824,7 +823,6 @@ enum { | |||
| 824 | CRASHED_PRIMARY, /* This node was a crashed primary. | 823 | CRASHED_PRIMARY, /* This node was a crashed primary. |
| 825 | * Gets cleared when the state.conn | 824 | * Gets cleared when the state.conn |
| 826 | * goes into C_CONNECTED state. */ | 825 | * goes into C_CONNECTED state. */ |
| 827 | NO_BARRIER_SUPP, /* underlying block device doesn't implement barriers */ | ||
| 828 | CONSIDER_RESYNC, | 826 | CONSIDER_RESYNC, |
| 829 | 827 | ||
| 830 | MD_NO_FUA, /* Users wants us to not use FUA/FLUSH on meta data dev */ | 828 | MD_NO_FUA, /* Users wants us to not use FUA/FLUSH on meta data dev */ |
| @@ -834,6 +832,7 @@ enum { | |||
| 834 | BITMAP_IO_QUEUED, /* Started bitmap IO */ | 832 | BITMAP_IO_QUEUED, /* Started bitmap IO */ |
| 835 | GO_DISKLESS, /* Disk is being detached, on io-error or admin request. */ | 833 | GO_DISKLESS, /* Disk is being detached, on io-error or admin request. */ |
| 836 | WAS_IO_ERROR, /* Local disk failed returned IO error */ | 834 | WAS_IO_ERROR, /* Local disk failed returned IO error */ |
