Skip to content

Commit 2c24478

Browse files
committed
Merge tag 'for-6.14/dm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm
Pull device mapper fixes from Mikulas Patocka: - dm-vdo: add missing spin_lock_init - dm-integrity: divide-by-zero fix - dm-integrity: do not report unused entries in the table line * tag 'for-6.14/dm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm: dm vdo: add missing spin_lock_init dm-integrity: Do not emit journal configuration in DM table for Inline mode dm-integrity: Avoid divide by zero in table status in Inline mode
2 parents f7d5db9 + 36e1b81 commit 2c24478

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

drivers/md/dm-integrity.c

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3790,20 +3790,18 @@ static void dm_integrity_status(struct dm_target *ti, status_type_t type,
37903790
break;
37913791

37923792
case STATUSTYPE_TABLE: {
3793-
__u64 watermark_percentage = (__u64)(ic->journal_entries - ic->free_sectors_threshold) * 100;
3794-
3795-
watermark_percentage += ic->journal_entries / 2;
3796-
do_div(watermark_percentage, ic->journal_entries);
3797-
arg_count = 3;
3793+
arg_count = 1; /* buffer_sectors */
37983794
arg_count += !!ic->meta_dev;
37993795
arg_count += ic->sectors_per_block != 1;
38003796
arg_count += !!(ic->sb->flags & cpu_to_le32(SB_FLAG_RECALCULATING));
38013797
arg_count += ic->reset_recalculate_flag;
38023798
arg_count += ic->discard;
3803-
arg_count += ic->mode == 'J';
3804-
arg_count += ic->mode == 'J';
3805-
arg_count += ic->mode == 'B';
3806-
arg_count += ic->mode == 'B';
3799+
arg_count += ic->mode != 'I'; /* interleave_sectors */
3800+
arg_count += ic->mode == 'J'; /* journal_sectors */
3801+
arg_count += ic->mode == 'J'; /* journal_watermark */
3802+
arg_count += ic->mode == 'J'; /* commit_time */
3803+
arg_count += ic->mode == 'B'; /* sectors_per_bit */
3804+
arg_count += ic->mode == 'B'; /* bitmap_flush_interval */
38073805
arg_count += !!ic->internal_hash_alg.alg_string;
38083806
arg_count += !!ic->journal_crypt_alg.alg_string;
38093807
arg_count += !!ic->journal_mac_alg.alg_string;
@@ -3822,10 +3820,15 @@ static void dm_integrity_status(struct dm_target *ti, status_type_t type,
38223820
DMEMIT(" reset_recalculate");
38233821
if (ic->discard)
38243822
DMEMIT(" allow_discards");
3825-
DMEMIT(" journal_sectors:%u", ic->initial_sectors - SB_SECTORS);
3826-
DMEMIT(" interleave_sectors:%u", 1U << ic->sb->log2_interleave_sectors);
3823+
if (ic->mode != 'I')
3824+
DMEMIT(" interleave_sectors:%u", 1U << ic->sb->log2_interleave_sectors);
38273825
DMEMIT(" buffer_sectors:%u", 1U << ic->log2_buffer_sectors);
38283826
if (ic->mode == 'J') {
3827+
__u64 watermark_percentage = (__u64)(ic->journal_entries - ic->free_sectors_threshold) * 100;
3828+
3829+
watermark_percentage += ic->journal_entries / 2;
3830+
do_div(watermark_percentage, ic->journal_entries);
3831+
DMEMIT(" journal_sectors:%u", ic->initial_sectors - SB_SECTORS);
38293832
DMEMIT(" journal_watermark:%u", (unsigned int)watermark_percentage);
38303833
DMEMIT(" commit_time:%u", ic->autocommit_msec);
38313834
}

drivers/md/dm-vdo/dedupe.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2178,6 +2178,7 @@ static int initialize_index(struct vdo *vdo, struct hash_zones *zones)
21782178

21792179
vdo_set_dedupe_index_timeout_interval(vdo_dedupe_index_timeout_interval);
21802180
vdo_set_dedupe_index_min_timer_interval(vdo_dedupe_index_min_timer_interval);
2181+
spin_lock_init(&zones->lock);
21812182

21822183
/*
21832184
* Since we will save up the timeouts that would have been reported but were ratelimited,

0 commit comments

Comments
 (0)