Skip to content

Commit abd792f

Browse files
committed
Merge tag 'dm-6.7/dm-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm
Pull device mapper fixes from Mike Snitzer: - Fix DM verity target's FEC support to always initialize IO before it frees it. Also fix alignment of struct dm_verity_fec_io within the per-bio-data - Fix DM verity target to not FEC failed readahead IO - Update DM flakey target to use MAX_ORDER rather than MAX_ORDER - 1 * tag 'dm-6.7/dm-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm: dm-flakey: start allocating with MAX_ORDER dm-verity: align struct dm_verity_fec_io properly dm verity: don't perform FEC for failed readahead IO dm verity: initialize fec io before freeing it
2 parents ff4a9f4 + 41e0554 commit abd792f

File tree

4 files changed

+8
-10
lines changed

4 files changed

+8
-10
lines changed

drivers/md/dm-flakey.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ static struct bio *clone_bio(struct dm_target *ti, struct flakey_c *fc, struct b
434434

435435
remaining_size = size;
436436

437-
order = MAX_ORDER - 1;
437+
order = MAX_ORDER;
438438
while (remaining_size) {
439439
struct page *pages;
440440
unsigned size_to_add, to_copy;

drivers/md/dm-verity-fec.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ bool verity_fec_is_enabled(struct dm_verity *v)
2424
*/
2525
static inline struct dm_verity_fec_io *fec_io(struct dm_verity_io *io)
2626
{
27-
return (struct dm_verity_fec_io *) verity_io_digest_end(io->v, io);
27+
return (struct dm_verity_fec_io *)
28+
((char *)io + io->v->ti->per_io_data_size - sizeof(struct dm_verity_fec_io));
2829
}
2930

3031
/*

drivers/md/dm-verity-target.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,6 @@ static void verity_work(struct work_struct *w)
642642

643643
io->in_tasklet = false;
644644

645-
verity_fec_init_io(io);
646645
verity_finish_io(io, errno_to_blk_status(verity_verify_io(io)));
647646
}
648647

@@ -668,7 +667,9 @@ static void verity_end_io(struct bio *bio)
668667
struct dm_verity_io *io = bio->bi_private;
669668

670669
if (bio->bi_status &&
671-
(!verity_fec_is_enabled(io->v) || verity_is_system_shutting_down())) {
670+
(!verity_fec_is_enabled(io->v) ||
671+
verity_is_system_shutting_down() ||
672+
(bio->bi_opf & REQ_RAHEAD))) {
672673
verity_finish_io(io, bio->bi_status);
673674
return;
674675
}
@@ -792,6 +793,8 @@ static int verity_map(struct dm_target *ti, struct bio *bio)
792793
bio->bi_private = io;
793794
io->iter = bio->bi_iter;
794795

796+
verity_fec_init_io(io);
797+
795798
verity_submit_prefetch(v, io);
796799

797800
submit_bio_noacct(bio);

drivers/md/dm-verity.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,6 @@ static inline u8 *verity_io_want_digest(struct dm_verity *v,
115115
return (u8 *)(io + 1) + v->ahash_reqsize + v->digest_size;
116116
}
117117

118-
static inline u8 *verity_io_digest_end(struct dm_verity *v,
119-
struct dm_verity_io *io)
120-
{
121-
return verity_io_want_digest(v, io) + v->digest_size;
122-
}
123-
124118
extern int verity_for_bv_block(struct dm_verity *v, struct dm_verity_io *io,
125119
struct bvec_iter *iter,
126120
int (*process)(struct dm_verity *v,

0 commit comments

Comments
 (0)