提交 341c2453 编写于 作者: Y Yu Kuai 提交者: Zheng Zengkai

block: fix kabi broken in struct hd_struct

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I57S8D
CVE: NA

--------------------------------

Use reserved fields to fix kabi broken for field 'stat_time'. However,
for the field 'bd_stat_lock', spinlock_t can be up to 64 bytes, thus
reserved fields is not enough. And struct 'hd_struct' is internal of
other sutrct, thus declare a wrapper is infeasible. In order to fix
kabi broken for 'bd_stat_lock', use 'dev->mutex' instead.
Signed-off-by: NYu Kuai <yukuai3@huawei.com>
Reviewed-by: NJason Yan <yanaijie@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 f60df4a0
...@@ -1312,10 +1312,10 @@ static void part_get_stat_info(struct hd_struct *hd, struct disk_stats *stat, ...@@ -1312,10 +1312,10 @@ static void part_get_stat_info(struct hd_struct *hd, struct disk_stats *stat,
if (queue_is_mq(q)) { if (queue_is_mq(q)) {
part_stat_lock(); part_stat_lock();
spin_lock(&hd->bd_stat_lock); mutex_lock(&part_to_dev(hd)->mutex);
part_set_stat_time(hd); part_set_stat_time(hd);
*inflight = blk_mq_in_flight_with_stat(q, hd); *inflight = blk_mq_in_flight_with_stat(q, hd);
spin_unlock(&hd->bd_stat_lock); mutex_unlock(&part_to_dev(hd)->mutex);
part_stat_unlock(); part_stat_unlock();
} else { } else {
*inflight = part_in_flight(hd); *inflight = part_in_flight(hd);
......
...@@ -416,7 +416,6 @@ static struct hd_struct *add_partition(struct gendisk *disk, int partno, ...@@ -416,7 +416,6 @@ static struct hd_struct *add_partition(struct gendisk *disk, int partno,
p->partno = partno; p->partno = partno;
p->read_only = get_disk_ro(disk) | test_bit(partno, disk->user_ro_bitmap); p->read_only = get_disk_ro(disk) | test_bit(partno, disk->user_ro_bitmap);
p->stat_time = 0; p->stat_time = 0;
spin_lock_init(&p->bd_stat_lock);
if (info) { if (info) {
struct partition_meta_info *pinfo; struct partition_meta_info *pinfo;
......
...@@ -63,8 +63,6 @@ struct hd_struct { ...@@ -63,8 +63,6 @@ struct hd_struct {
seqcount_t nr_sects_seq; seqcount_t nr_sects_seq;
#endif #endif
unsigned long stamp; unsigned long stamp;
spinlock_t bd_stat_lock;
u64 stat_time;
struct disk_stats __percpu *dkstats; struct disk_stats __percpu *dkstats;
struct percpu_ref ref; struct percpu_ref ref;
...@@ -78,7 +76,7 @@ struct hd_struct { ...@@ -78,7 +76,7 @@ struct hd_struct {
#endif #endif
struct rcu_work rcu_work; struct rcu_work rcu_work;
KABI_RESERVE(1) KABI_USE(1, u64 stat_time)
KABI_RESERVE(2) KABI_RESERVE(2)
KABI_RESERVE(3) KABI_RESERVE(3)
KABI_RESERVE(4) KABI_RESERVE(4)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册