Skip to content

Commit 8b5cdbe

Browse files
committed
Merge tag 'for-5.0/dm-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm
Pull device mapper fixes from Mike Snitzer: "Both of these fixes address issues in changes merged for 5.0-rc4: - Fix DM core's missing memory barrier before waitqueue_active() calls. - Fix DM core's clone_bio() to work when cloning a subset of a bio with an integrity payload; bio_integrity_trim() wasn't getting called due to bio_trim()'s early return" * tag 'for-5.0/dm-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm: dm: don't use bio_trim() afterall dm: add memory barrier before waitqueue_active
2 parents d47e3da + fa8db49 commit 8b5cdbe

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

drivers/md/dm-rq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ static void rq_end_stats(struct mapped_device *md, struct request *orig)
131131
static void rq_completed(struct mapped_device *md)
132132
{
133133
/* nudge anyone waiting on suspend queue */
134-
if (unlikely(waitqueue_active(&md->wait)))
134+
if (unlikely(wq_has_sleeper(&md->wait)))
135135
wake_up(&md->wait);
136136

137137
/*

drivers/md/dm.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@ static void end_io_acct(struct dm_io *io)
699699
true, duration, &io->stats_aux);
700700

701701
/* nudge anyone waiting on suspend queue */
702-
if (unlikely(waitqueue_active(&md->wait)))
702+
if (unlikely(wq_has_sleeper(&md->wait)))
703703
wake_up(&md->wait);
704704
}
705705

@@ -1336,7 +1336,11 @@ static int clone_bio(struct dm_target_io *tio, struct bio *bio,
13361336
return r;
13371337
}
13381338

1339-
bio_trim(clone, sector - clone->bi_iter.bi_sector, len);
1339+
bio_advance(clone, to_bytes(sector - clone->bi_iter.bi_sector));
1340+
clone->bi_iter.bi_size = to_bytes(len);
1341+
1342+
if (bio_integrity(bio))
1343+
bio_integrity_trim(clone);
13401344

13411345
return 0;
13421346
}

0 commit comments

Comments
 (0)