Skip to content

Commit 9c0c4d2

Browse files
committed
Merge tag 'block-5.15-2021-10-22' of git://git.kernel.dk/linux-block
Pull block fixes from Jens Axboe: "Fix for the cgroup code not ussing irq safe stats updates, and one fix for an error handling condition in add_partition()" * tag 'block-5.15-2021-10-22' of git://git.kernel.dk/linux-block: block: fix incorrect references to disk objects blk-cgroup: blk_cgroup_bio_start() should use irq-safe operations on blkg->iostat_cpu
2 parents da4d34b + 9fbfabf commit 9c0c4d2

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

block/blk-cgroup.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1897,10 +1897,11 @@ void blk_cgroup_bio_start(struct bio *bio)
18971897
{
18981898
int rwd = blk_cgroup_io_type(bio), cpu;
18991899
struct blkg_iostat_set *bis;
1900+
unsigned long flags;
19001901

19011902
cpu = get_cpu();
19021903
bis = per_cpu_ptr(bio->bi_blkg->iostat_cpu, cpu);
1903-
u64_stats_update_begin(&bis->sync);
1904+
flags = u64_stats_update_begin_irqsave(&bis->sync);
19041905

19051906
/*
19061907
* If the bio is flagged with BIO_CGROUP_ACCT it means this is a split
@@ -1912,7 +1913,7 @@ void blk_cgroup_bio_start(struct bio *bio)
19121913
}
19131914
bis->cur.ios[rwd]++;
19141915

1915-
u64_stats_update_end(&bis->sync);
1916+
u64_stats_update_end_irqrestore(&bis->sync, flags);
19161917
if (cgroup_subsys_on_dfl(io_cgrp_subsys))
19171918
cgroup_rstat_updated(bio->bi_blkg->blkcg->css.cgroup, cpu);
19181919
put_cpu();

block/partitions/core.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,7 @@ static struct block_device *add_partition(struct gendisk *disk, int partno,
423423
device_del(pdev);
424424
out_put:
425425
put_device(pdev);
426+
return ERR_PTR(err);
426427
out_put_disk:
427428
put_disk(disk);
428429
return ERR_PTR(err);

0 commit comments

Comments
 (0)