Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'for-5.19/dm-fixes-4' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm

Pull device mapper fixes from Mike Snitzer:

- Fix DM era to commit metadata during suspend using drain_workqueue
instead of flush_workqueue.

- Fix DM core's dm_io_complete to not return early if io error is
BLK_STS_AGAIN but bio polling is not in use.

- Fix DM core's dm_io_complete BLK_STS_DM_REQUEUE handling when dm_io
represents a split bio.

- Fix recent DM mirror log regression by clearing bits up to
BITS_PER_LONG boundary.

* tag 'for-5.19/dm-fixes-4' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm:
dm mirror log: clear log bits up to BITS_PER_LONG boundary
dm: fix BLK_STS_DM_REQUEUE handling when dm_io represents split bio
dm: do not return early from dm_io_complete if BLK_STS_AGAIN without polling
dm era: commit metadata in postsuspend after worker stops

+19 -7
+1
drivers/md/dm-core.h
··· 272 272 atomic_t io_count; 273 273 struct mapped_device *md; 274 274 275 + struct bio *split_bio; 275 276 /* The three fields represent mapped part of original bio */ 276 277 struct bio *orig_bio; 277 278 unsigned int sector_offset; /* offset to end of orig_bio */
+7 -1
drivers/md/dm-era-target.c
··· 1400 1400 static void stop_worker(struct era *era) 1401 1401 { 1402 1402 atomic_set(&era->suspended, 1); 1403 - flush_workqueue(era->wq); 1403 + drain_workqueue(era->wq); 1404 1404 } 1405 1405 1406 1406 /*---------------------------------------------------------------- ··· 1570 1570 } 1571 1571 1572 1572 stop_worker(era); 1573 + 1574 + r = metadata_commit(era->md); 1575 + if (r) { 1576 + DMERR("%s: metadata_commit failed", __func__); 1577 + /* FIXME: fail mode */ 1578 + } 1573 1579 } 1574 1580 1575 1581 static int era_preresume(struct dm_target *ti)
+1 -1
drivers/md/dm-log.c
··· 615 615 log_clear_bit(lc, lc->clean_bits, i); 616 616 617 617 /* clear any old bits -- device has shrunk */ 618 - for (i = lc->region_count; i % (sizeof(*lc->clean_bits) << BYTE_SHIFT); i++) 618 + for (i = lc->region_count; i % BITS_PER_LONG; i++) 619 619 log_clear_bit(lc, lc->clean_bits, i); 620 620 621 621 /* copy clean across to sync */
+10 -5
drivers/md/dm.c
··· 594 594 atomic_set(&io->io_count, 2); 595 595 this_cpu_inc(*md->pending_io); 596 596 io->orig_bio = bio; 597 + io->split_bio = NULL; 597 598 io->md = md; 598 599 spin_lock_init(&io->lock); 599 600 io->start_time = jiffies; ··· 888 887 { 889 888 blk_status_t io_error; 890 889 struct mapped_device *md = io->md; 891 - struct bio *bio = io->orig_bio; 890 + struct bio *bio = io->split_bio ? io->split_bio : io->orig_bio; 892 891 893 892 if (io->status == BLK_STS_DM_REQUEUE) { 894 893 unsigned long flags; ··· 940 939 if (io_error == BLK_STS_AGAIN) { 941 940 /* io_uring doesn't handle BLK_STS_AGAIN (yet) */ 942 941 queue_io(md, bio); 942 + return; 943 943 } 944 944 } 945 - return; 945 + if (io_error == BLK_STS_DM_REQUEUE) 946 + return; 946 947 } 947 948 948 949 if (bio_is_flush_with_data(bio)) { ··· 1694 1691 * Remainder must be passed to submit_bio_noacct() so it gets handled 1695 1692 * *after* bios already submitted have been completely processed. 1696 1693 */ 1697 - bio_trim(bio, io->sectors, ci.sector_count); 1698 - trace_block_split(bio, bio->bi_iter.bi_sector); 1699 - bio_inc_remaining(bio); 1694 + WARN_ON_ONCE(!dm_io_flagged(io, DM_IO_WAS_SPLIT)); 1695 + io->split_bio = bio_split(bio, io->sectors, GFP_NOIO, 1696 + &md->queue->bio_split); 1697 + bio_chain(io->split_bio, bio); 1698 + trace_block_split(io->split_bio, bio->bi_iter.bi_sector); 1700 1699 submit_bio_noacct(bio); 1701 1700 out: 1702 1701 /*