diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-12-20 12:19:46 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-12-20 12:19:46 -0500 |
commit | 7f8635cc9e66a26d7280ba680b044fa2f65104af (patch) | |
tree | 0d8506e86d07e15c473aca1a09af7ad6ff7d8b49 /drivers | |
parent | 3cb50ddf97a0a1ca4c68bc12fa1e727a6b45fbf2 (diff) | |
parent | 0fc13c8995cd96f4123de400c71c223d80400ed9 (diff) |
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
* 'for-linus' of git://git.kernel.dk/linux-2.6-block:
cciss: fix cciss_revalidate panic
block: max hardware sectors limit wrapper
block: Deprecate QUEUE_FLAG_CLUSTER and use queue_limits instead
blk-throttle: Correct the placement of smp_rmb()
blk-throttle: Trim/adjust slice_end once a bio has been dispatched
block: check for proper length of iov entries earlier in blk_rq_map_user_iov()
drbd: fix for spin_lock_irqsave in endio callback
drbd: don't recvmsg with zero length
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/block/cciss.c | 2 | ||||
-rw-r--r-- | drivers/block/drbd/drbd_receiver.c | 14 | ||||
-rw-r--r-- | drivers/block/drbd/drbd_req.h | 3 | ||||
-rw-r--r-- | drivers/block/drbd/drbd_worker.c | 10 | ||||
-rw-r--r-- | drivers/md/dm-table.c | 10 | ||||
-rw-r--r-- | drivers/md/md.c | 3 | ||||
-rw-r--r-- | drivers/scsi/scsi_lib.c | 3 |
7 files changed, 24 insertions, 21 deletions
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index f291587d753e..233e06c29ff4 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c | |||
@@ -2834,6 +2834,8 @@ static int cciss_revalidate(struct gendisk *disk) | |||
2834 | InquiryData_struct *inq_buff = NULL; | 2834 | InquiryData_struct *inq_buff = NULL; |
2835 | 2835 | ||
2836 | for (logvol = 0; logvol < CISS_MAX_LUN; logvol++) { | 2836 | for (logvol = 0; logvol < CISS_MAX_LUN; logvol++) { |
2837 | if (!h->drv[logvol]) | ||
2838 | continue | ||
2837 | if (memcmp(h->drv[logvol]->LunID, drv->LunID, | 2839 | if (memcmp(h->drv[logvol]->LunID, drv->LunID, |
2838 | sizeof(drv->LunID)) == 0) { | 2840 | sizeof(drv->LunID)) == 0) { |
2839 | FOUND = 1; | 2841 | FOUND = 1; |
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index 89d8a7cc4054..24487d4fb202 100644 --- a/drivers/block/drbd/drbd_receiver.c +++ b/drivers/block/drbd/drbd_receiver.c | |||
@@ -3627,17 +3627,19 @@ static void drbdd(struct drbd_conf *mdev) | |||
3627 | } | 3627 | } |
3628 | 3628 | ||
3629 | shs = drbd_cmd_handler[cmd].pkt_size - sizeof(union p_header); | 3629 | shs = drbd_cmd_handler[cmd].pkt_size - sizeof(union p_header); |
3630 | rv = drbd_recv(mdev, &header->h80.payload, shs); | ||
3631 | if (unlikely(rv != shs)) { | ||
3632 | dev_err(DEV, "short read while reading sub header: rv=%d\n", rv); | ||
3633 | goto err_out; | ||
3634 | } | ||
3635 | |||
3636 | if (packet_size - shs > 0 && !drbd_cmd_handler[cmd].expect_payload) { | 3630 | if (packet_size - shs > 0 && !drbd_cmd_handler[cmd].expect_payload) { |
3637 | dev_err(DEV, "No payload expected %s l:%d\n", cmdname(cmd), packet_size); | 3631 | dev_err(DEV, "No payload expected %s l:%d\n", cmdname(cmd), packet_size); |
3638 | goto err_out; | 3632 | goto err_out; |
3639 | } | 3633 | } |
3640 | 3634 | ||
3635 | if (shs) { | ||
3636 | rv = drbd_recv(mdev, &header->h80.payload, shs); | ||
3637 | if (unlikely(rv != shs)) { | ||
3638 | dev_err(DEV, "short read while reading sub header: rv=%d\n", rv); | ||
3639 | goto err_out; | ||
3640 | } | ||
3641 | } | ||
3642 | |||
3641 | rv = drbd_cmd_handler[cmd].function(mdev, cmd, packet_size - shs); | 3643 | rv = drbd_cmd_handler[cmd].function(mdev, cmd, packet_size - shs); |
3642 | 3644 | ||
3643 | if (unlikely(!rv)) { | 3645 | if (unlikely(!rv)) { |
diff --git a/drivers/block/drbd/drbd_req.h b/drivers/block/drbd/drbd_req.h index 181ea0364822..ab2bd09d54b4 100644 --- a/drivers/block/drbd/drbd_req.h +++ b/drivers/block/drbd/drbd_req.h | |||
@@ -339,7 +339,8 @@ static inline int _req_mod(struct drbd_request *req, enum drbd_req_event what) | |||
339 | } | 339 | } |
340 | 340 | ||
341 | /* completion of master bio is outside of spinlock. | 341 | /* completion of master bio is outside of spinlock. |
342 | * If you need it irqsave, do it your self! */ | 342 | * If you need it irqsave, do it your self! |
343 | * Which means: don't use from bio endio callback. */ | ||
343 | static inline int req_mod(struct drbd_request *req, | 344 | static inline int req_mod(struct drbd_request *req, |
344 | enum drbd_req_event what) | 345 | enum drbd_req_event what) |
345 | { | 346 | { |
diff --git a/drivers/block/drbd/drbd_worker.c b/drivers/block/drbd/drbd_worker.c index 47d223c2409c..34f224b018b3 100644 --- a/drivers/block/drbd/drbd_worker.c +++ b/drivers/block/drbd/drbd_worker.c | |||
@@ -193,8 +193,10 @@ void drbd_endio_sec(struct bio *bio, int error) | |||
193 | */ | 193 | */ |
194 | void drbd_endio_pri(struct bio *bio, int error) | 194 | void drbd_endio_pri(struct bio *bio, int error) |
195 | { | 195 | { |
196 | unsigned long flags; | ||
196 | struct drbd_request *req = bio->bi_private; | 197 | struct drbd_request *req = bio->bi_private; |
197 | struct drbd_conf *mdev = req->mdev; | 198 | struct drbd_conf *mdev = req->mdev; |
199 | struct bio_and_error m; | ||
198 | enum drbd_req_event what; | 200 | enum drbd_req_event what; |
199 | int uptodate = bio_flagged(bio, BIO_UPTODATE); | 201 | int uptodate = bio_flagged(bio, BIO_UPTODATE); |
200 | 202 | ||
@@ -220,7 +222,13 @@ void drbd_endio_pri(struct bio *bio, int error) | |||
220 | bio_put(req->private_bio); | 222 | bio_put(req->private_bio); |
221 | req->private_bio = ERR_PTR(error); | 223 | req->private_bio = ERR_PTR(error); |
222 | 224 | ||
223 | req_mod(req, what); | 225 | /* not req_mod(), we need irqsave here! */ |
226 | spin_lock_irqsave(&mdev->req_lock, flags); | ||
227 | __req_mod(req, what, &m); | ||
228 | spin_unlock_irqrestore(&mdev->req_lock, flags); | ||
229 | |||
230 | if (m.bio) | ||
231 | complete_master_bio(mdev, &m); | ||
224 | } | 232 | } |
225 | 233 | ||
226 | int w_read_retry_remote(struct drbd_conf *mdev, struct drbd_work *w, int cancel) | 234 | int w_read_retry_remote(struct drbd_conf *mdev, struct drbd_work *w, int cancel) |
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c index 90267f8d64ee..4d705cea0f8c 100644 --- a/drivers/md/dm-table.c +++ b/drivers/md/dm-table.c | |||
@@ -517,9 +517,8 @@ int dm_set_device_limits(struct dm_target *ti, struct dm_dev *dev, | |||
517 | */ | 517 | */ |
518 | 518 | ||
519 | if (q->merge_bvec_fn && !ti->type->merge) | 519 | if (q->merge_bvec_fn && !ti->type->merge) |
520 | limits->max_sectors = | 520 | blk_limits_max_hw_sectors(limits, |
521 | min_not_zero(limits->max_sectors, | 521 | (unsigned int) (PAGE_SIZE >> 9)); |
522 | (unsigned int) (PAGE_SIZE >> 9)); | ||
523 | return 0; | 522 | return 0; |
524 | } | 523 | } |
525 | EXPORT_SYMBOL_GPL(dm_set_device_limits); | 524 | EXPORT_SYMBOL_GPL(dm_set_device_limits); |
@@ -1131,11 +1130,6 @@ void dm_table_set_restrictions(struct dm_table *t, struct request_queue *q, | |||
1131 | */ | 1130 | */ |
1132 | q->limits = *limits; | 1131 | q->limits = *limits; |
1133 | 1132 | ||
1134 | if (limits->no_cluster) | ||
1135 | queue_flag_clear_unlocked(QUEUE_FLAG_CLUSTER, q); | ||
1136 | else | ||
1137 | queue_flag_set_unlocked(QUEUE_FLAG_CLUSTER, q); | ||
1138 | |||
1139 | if (!dm_table_supports_discards(t)) | 1133 | if (!dm_table_supports_discards(t)) |
1140 | queue_flag_clear_unlocked(QUEUE_FLAG_DISCARD, q); | 1134 | queue_flag_clear_unlocked(QUEUE_FLAG_DISCARD, q); |
1141 | else | 1135 | else |
diff --git a/drivers/md/md.c b/drivers/md/md.c index e71c5fa527f5..175c424f201f 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -4295,9 +4295,6 @@ static int md_alloc(dev_t dev, char *name) | |||
4295 | goto abort; | 4295 | goto abort; |
4296 | mddev->queue->queuedata = mddev; | 4296 | mddev->queue->queuedata = mddev; |
4297 | 4297 | ||
4298 | /* Can be unlocked because the queue is new: no concurrency */ | ||
4299 | queue_flag_set_unlocked(QUEUE_FLAG_CLUSTER, mddev->queue); | ||
4300 | |||
4301 | blk_queue_make_request(mddev->queue, md_make_request); | 4298 | blk_queue_make_request(mddev->queue, md_make_request); |
4302 | 4299 | ||
4303 | disk = alloc_disk(1 << shift); | 4300 | disk = alloc_disk(1 << shift); |
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 5b6bbaea59fe..4a3842212c50 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c | |||
@@ -1637,9 +1637,8 @@ struct request_queue *__scsi_alloc_queue(struct Scsi_Host *shost, | |||
1637 | 1637 | ||
1638 | blk_queue_max_segment_size(q, dma_get_max_seg_size(dev)); | 1638 | blk_queue_max_segment_size(q, dma_get_max_seg_size(dev)); |
1639 | 1639 | ||
1640 | /* New queue, no concurrency on queue_flags */ | ||
1641 | if (!shost->use_clustering) | 1640 | if (!shost->use_clustering) |
1642 | queue_flag_clear_unlocked(QUEUE_FLAG_CLUSTER, q); | 1641 | q->limits.cluster = 0; |
1643 | 1642 | ||
1644 | /* | 1643 | /* |
1645 | * set a reasonable default alignment on word boundaries: the | 1644 | * set a reasonable default alignment on word boundaries: the |