Commit 0a7a93d9 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'dm-6.7/dm-fixes-3' of...

Merge tag 'dm-6.7/dm-fixes-3' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm

Pull device mapper fixes from Mike Snitzer:

 - DM raid target (and MD raid) fix for reconfig_mutex MD deadlock that
   should have been merged along with recent v6.7-rc6 MD fixes (see MD
   related commits: f2d87a75^..b3911334)

 - DM integrity target fix to avoid modifying immutable biovec in the
   integrity_metadata() edge case where kmalloc fails.

 - Fix drivers/md/Kconfig so DM_AUDIT depends on BLK_DEV_DM.

 - Update DM entry in MAINTAINERS to remove stale info.

* tag 'dm-6.7/dm-fixes-3' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm:
  MAINTAINERS: remove stale info for DEVICE-MAPPER
  dm audit: fix Kconfig so DM_AUDIT depends on BLK_DEV_DM
  dm-integrity: don't modify bio's immutable bio_vec in integrity_metadata()
  dm-raid: delay flushing event_work() after reconfig_mutex is released
parents 55cb5f43 5d6f447b
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -6050,10 +6050,8 @@ M: Mikulas Patocka <mpatocka@redhat.com>
M:	dm-devel@lists.linux.dev
L:	dm-devel@lists.linux.dev
S:	Maintained
W:	http://sources.redhat.com/dm
Q:	http://patchwork.kernel.org/project/dm-devel/list/
T:	git git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm.git
T:	quilt http://people.redhat.com/agk/patches/linux/editing/
F:	Documentation/admin-guide/device-mapper/
F:	drivers/md/Kconfig
F:	drivers/md/Makefile
+1 −0
Original line number Diff line number Diff line
@@ -660,6 +660,7 @@ config DM_ZONED

config DM_AUDIT
	bool "DM audit events"
	depends on BLK_DEV_DM
	depends on AUDIT
	help
	  Generate audit events for device-mapper.
+6 −5
Original line number Diff line number Diff line
@@ -1755,11 +1755,12 @@ static void integrity_metadata(struct work_struct *w)
		sectors_to_process = dio->range.n_sectors;

		__bio_for_each_segment(bv, bio, iter, dio->bio_details.bi_iter) {
			struct bio_vec bv_copy = bv;
			unsigned int pos;
			char *mem, *checksums_ptr;

again:
			mem = bvec_kmap_local(&bv);
			mem = bvec_kmap_local(&bv_copy);
			pos = 0;
			checksums_ptr = checksums;
			do {
@@ -1768,7 +1769,7 @@ static void integrity_metadata(struct work_struct *w)
				sectors_to_process -= ic->sectors_per_block;
				pos += ic->sectors_per_block << SECTOR_SHIFT;
				sector += ic->sectors_per_block;
			} while (pos < bv.bv_len && sectors_to_process && checksums != checksums_onstack);
			} while (pos < bv_copy.bv_len && sectors_to_process && checksums != checksums_onstack);
			kunmap_local(mem);

			r = dm_integrity_rw_tag(ic, checksums, &dio->metadata_block, &dio->metadata_offset,
@@ -1793,9 +1794,9 @@ static void integrity_metadata(struct work_struct *w)
			if (!sectors_to_process)
				break;

			if (unlikely(pos < bv.bv_len)) {
				bv.bv_offset += pos;
				bv.bv_len -= pos;
			if (unlikely(pos < bv_copy.bv_len)) {
				bv_copy.bv_offset += pos;
				bv_copy.bv_len -= pos;
				goto again;
			}
		}
+3 −0
Original line number Diff line number Diff line
@@ -3317,6 +3317,9 @@ static void raid_dtr(struct dm_target *ti)
	mddev_lock_nointr(&rs->md);
	md_stop(&rs->md);
	mddev_unlock(&rs->md);

	if (work_pending(&rs->md.event_work))
		flush_work(&rs->md.event_work);
	raid_set_free(rs);
}

+8 −3
Original line number Diff line number Diff line
@@ -82,6 +82,14 @@ static struct module *md_cluster_mod;

static DECLARE_WAIT_QUEUE_HEAD(resync_wait);
static struct workqueue_struct *md_wq;

/*
 * This workqueue is used for sync_work to register new sync_thread, and for
 * del_work to remove rdev, and for event_work that is only set by dm-raid.
 *
 * Noted that sync_work will grab reconfig_mutex, hence never flush this
 * workqueue whith reconfig_mutex grabbed.
 */
static struct workqueue_struct *md_misc_wq;
struct workqueue_struct *md_bitmap_wq;

@@ -6330,9 +6338,6 @@ static void __md_stop(struct mddev *mddev)
	struct md_personality *pers = mddev->pers;
	md_bitmap_destroy(mddev);
	mddev_detach(mddev);
	/* Ensure ->event_work is done */
	if (mddev->event_work.func)
		flush_workqueue(md_misc_wq);
	spin_lock(&mddev->lock);
	mddev->pers = NULL;
	spin_unlock(&mddev->lock);