[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20211210120631.2578505-1-lijinlin3@huawei.com>
Date: Fri, 10 Dec 2021 20:06:28 +0800
From: Li Jinlin <lijinlin3@...wei.com>
To: <song@...nel.org>, <philipp.reisner@...bit.com>,
<lars.ellenberg@...bit.com>, <axboe@...nel.dk>, <hare@...e.de>,
<jack@...e.cz>, <ming.lei@...hat.com>, <tj@...nel.org>,
<mcgrof@...nel.org>
CC: <linux-raid@...r.kernel.org>, <linux-block@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <linfeilong@...wei.com>
Subject: [PATCH v3 0/3] Fix undefined behaviour during device synchronization
md/drbd drivers use 'signed int' variable to track sync vs non-sync IO,
and judge whether sync IO needs to be throttled by signed comparison.
If the value of the variable is greater than INT_MAX or close to
INT_MAX, some undefined behavior may occur.
Fix by using 64bit signed integer type.
differences to v2:
- Don't move sync_io variable form struct gendisk to struct md_rdev
in these patch
- fix typo in suject
The v2 "md: Fix undefined behaviour in is_mddev_idle" patch
differences to v1:
- add ubsan info in message
- use 64bit signed integer type instead of long type;
- move sync_io variable form struct gendisk to struct md_rdev, and
modify md_sync_acct() and md_sync_acct_bio() to fit for this change.
Li Jinlin (3):
md: Fix undefined behaviour in is_mddev_idle
drbd: Fix undefined behaviour in drbd_rs_c_min_rate_throttle
drbd: Remove useless variable in struct drbd_device
drivers/block/drbd/drbd_bitmap.c | 2 +-
drivers/block/drbd/drbd_int.h | 5 ++---
drivers/block/drbd/drbd_main.c | 3 +--
drivers/block/drbd/drbd_receiver.c | 12 ++++++------
drivers/block/drbd/drbd_state.c | 1 -
drivers/block/drbd/drbd_worker.c | 5 ++---
drivers/md/md.c | 6 +++---
drivers/md/md.h | 4 ++--
include/linux/genhd.h | 2 +-
9 files changed, 18 insertions(+), 22 deletions(-)
--
2.27.0
Powered by blists - more mailing lists