Skip to content

Commit

Permalink
Merge tag 'for-5.0/dm-fixes-2' of git://git.kernel.org/pub/scm/linux/…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
Linus Torvalds committed Feb 7, 2019
2 parents d47e3da + fa8db49 commit 8b5cdbe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion drivers/md/dm-rq.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ static void rq_end_stats(struct mapped_device *md, struct request *orig)
static void rq_completed(struct mapped_device *md)
{
/* nudge anyone waiting on suspend queue */
if (unlikely(waitqueue_active(&md->wait)))
if (unlikely(wq_has_sleeper(&md->wait)))
wake_up(&md->wait);

/*
Expand Down
8 changes: 6 additions & 2 deletions drivers/md/dm.c
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ static void end_io_acct(struct dm_io *io)
true, duration, &io->stats_aux);

/* nudge anyone waiting on suspend queue */
if (unlikely(waitqueue_active(&md->wait)))
if (unlikely(wq_has_sleeper(&md->wait)))
wake_up(&md->wait);
}

Expand Down Expand Up @@ -1336,7 +1336,11 @@ static int clone_bio(struct dm_target_io *tio, struct bio *bio,
return r;
}

bio_trim(clone, sector - clone->bi_iter.bi_sector, len);
bio_advance(clone, to_bytes(sector - clone->bi_iter.bi_sector));
clone->bi_iter.bi_size = to_bytes(len);

if (bio_integrity(bio))
bio_integrity_trim(clone);

return 0;
}
Expand Down

0 comments on commit 8b5cdbe

Please sign in to comment.