mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 10:04:04 +02:00
- fix integer overflow in dm-stripe
- limit tag size in dm-integrity to 255 bytes - fix 'alignment inconsistency' warning in dm-raid -----BEGIN PGP SIGNATURE----- iIoEABYIADIWIQRnH8MwLyZDhyYfesYTAyx9YGnhbQUCaMrAdRQcbXBhdG9ja2FA cmVkaGF0LmNvbQAKCRATAyx9YGnhbYhtAQDsWJHG7dOVuvoY+kyM9SmC2My6l5u2 awYBsjVT//9KDAD/c6s+ffeseY6VpBuFmPx5i75ieCmUcuKTMUxgdIErPwM= =FXwZ -----END PGP SIGNATURE----- Merge tag 'for-6.17/dm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm Pull device mapper fixes from Mikulas Patocka: - fix integer overflow in dm-stripe - limit tag size in dm-integrity to 255 bytes - fix 'alignment inconsistency' warning in dm-raid * tag 'for-6.17/dm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm: dm-raid: don't set io_min and io_opt for raid1 dm-integrity: limit MAX_TAG_SIZE to 255 dm-stripe: fix a possible integer overflow
This commit is contained in:
commit
d4b779985a
|
|
@ -133,7 +133,7 @@ struct journal_sector {
|
|||
commit_id_t commit_id;
|
||||
};
|
||||
|
||||
#define MAX_TAG_SIZE (JOURNAL_SECTOR_DATA - JOURNAL_MAC_PER_SECTOR - offsetof(struct journal_entry, last_bytes[MAX_SECTORS_PER_BLOCK]))
|
||||
#define MAX_TAG_SIZE 255
|
||||
|
||||
#define METADATA_PADDING_SECTORS 8
|
||||
|
||||
|
|
|
|||
|
|
@ -3813,8 +3813,10 @@ static void raid_io_hints(struct dm_target *ti, struct queue_limits *limits)
|
|||
struct raid_set *rs = ti->private;
|
||||
unsigned int chunk_size_bytes = to_bytes(rs->md.chunk_sectors);
|
||||
|
||||
limits->io_min = chunk_size_bytes;
|
||||
limits->io_opt = chunk_size_bytes * mddev_data_stripes(rs);
|
||||
if (chunk_size_bytes) {
|
||||
limits->io_min = chunk_size_bytes;
|
||||
limits->io_opt = chunk_size_bytes * mddev_data_stripes(rs);
|
||||
}
|
||||
}
|
||||
|
||||
static void raid_presuspend(struct dm_target *ti)
|
||||
|
|
|
|||
|
|
@ -456,11 +456,15 @@ static void stripe_io_hints(struct dm_target *ti,
|
|||
struct queue_limits *limits)
|
||||
{
|
||||
struct stripe_c *sc = ti->private;
|
||||
unsigned int chunk_size = sc->chunk_size << SECTOR_SHIFT;
|
||||
unsigned int io_min, io_opt;
|
||||
|
||||
limits->chunk_sectors = sc->chunk_size;
|
||||
limits->io_min = chunk_size;
|
||||
limits->io_opt = chunk_size * sc->stripes;
|
||||
|
||||
if (!check_shl_overflow(sc->chunk_size, SECTOR_SHIFT, &io_min) &&
|
||||
!check_mul_overflow(io_min, sc->stripes, &io_opt)) {
|
||||
limits->io_min = io_min;
|
||||
limits->io_opt = io_opt;
|
||||
}
|
||||
}
|
||||
|
||||
static struct target_type stripe_target = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user