Skip to content

Commit 11e7c21

Browse files
committed
Merge tag 'for-linus-20180605' of git://git.kernel.dk/linux-block
Pull block fixes from Jens Axboe: "This just contains the dm kzalloc fix that was discussed, and a fix that I queued up yesterday for a case where blk-mq doesn't honor the stop bit appropriately" * tag 'for-linus-20180605' of git://git.kernel.dk/linux-block: dm: Use kzalloc for all structs with embedded biosets/mempools blk-mq: return when hctx is stopped in blk_mq_run_work_fn
2 parents 9b68ac2 + d377535 commit 11e7c21

File tree

8 files changed

+8
-8
lines changed

8 files changed

+8
-8
lines changed

block/blk-mq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1475,7 +1475,7 @@ static void blk_mq_run_work_fn(struct work_struct *work)
14751475
* If we are stopped, don't run the queue.
14761476
*/
14771477
if (test_bit(BLK_MQ_S_STOPPED, &hctx->state))
1478-
clear_bit(BLK_MQ_S_STOPPED, &hctx->state);
1478+
return;
14791479

14801480
__blk_mq_run_hw_queue(hctx);
14811481
}

drivers/md/dm-bio-prison-v1.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ static struct kmem_cache *_cell_cache;
3333
*/
3434
struct dm_bio_prison *dm_bio_prison_create(void)
3535
{
36-
struct dm_bio_prison *prison = kmalloc(sizeof(*prison), GFP_KERNEL);
36+
struct dm_bio_prison *prison = kzalloc(sizeof(*prison), GFP_KERNEL);
3737
int ret;
3838

3939
if (!prison)

drivers/md/dm-bio-prison-v2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ static struct kmem_cache *_cell_cache;
3535
*/
3636
struct dm_bio_prison_v2 *dm_bio_prison_create_v2(struct workqueue_struct *wq)
3737
{
38-
struct dm_bio_prison_v2 *prison = kmalloc(sizeof(*prison), GFP_KERNEL);
38+
struct dm_bio_prison_v2 *prison = kzalloc(sizeof(*prison), GFP_KERNEL);
3939
int ret;
4040

4141
if (!prison)

drivers/md/dm-io.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ struct dm_io_client *dm_io_client_create(void)
5151
unsigned min_ios = dm_get_reserved_bio_based_ios();
5252
int ret;
5353

54-
client = kmalloc(sizeof(*client), GFP_KERNEL);
54+
client = kzalloc(sizeof(*client), GFP_KERNEL);
5555
if (!client)
5656
return ERR_PTR(-ENOMEM);
5757

drivers/md/dm-kcopyd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -882,7 +882,7 @@ struct dm_kcopyd_client *dm_kcopyd_client_create(struct dm_kcopyd_throttle *thro
882882
int r;
883883
struct dm_kcopyd_client *kc;
884884

885-
kc = kmalloc(sizeof(*kc), GFP_KERNEL);
885+
kc = kzalloc(sizeof(*kc), GFP_KERNEL);
886886
if (!kc)
887887
return ERR_PTR(-ENOMEM);
888888

drivers/md/dm-region-hash.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ struct dm_region_hash *dm_region_hash_create(
180180
;
181181
nr_buckets >>= 1;
182182

183-
rh = kmalloc(sizeof(*rh), GFP_KERNEL);
183+
rh = kzalloc(sizeof(*rh), GFP_KERNEL);
184184
if (!rh) {
185185
DMERR("unable to allocate region hash memory");
186186
return ERR_PTR(-ENOMEM);

drivers/md/dm-snap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1120,7 +1120,7 @@ static int snapshot_ctr(struct dm_target *ti, unsigned int argc, char **argv)
11201120
origin_mode = FMODE_WRITE;
11211121
}
11221122

1123-
s = kmalloc(sizeof(*s), GFP_KERNEL);
1123+
s = kzalloc(sizeof(*s), GFP_KERNEL);
11241124
if (!s) {
11251125
ti->error = "Cannot allocate private snapshot structure";
11261126
r = -ENOMEM;

drivers/md/dm-thin.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2861,7 +2861,7 @@ static struct pool *pool_create(struct mapped_device *pool_md,
28612861
return (struct pool *)pmd;
28622862
}
28632863

2864-
pool = kmalloc(sizeof(*pool), GFP_KERNEL);
2864+
pool = kzalloc(sizeof(*pool), GFP_KERNEL);
28652865
if (!pool) {
28662866
*error = "Error allocating memory for pool";
28672867
err_p = ERR_PTR(-ENOMEM);

0 commit comments

Comments
 (0)