Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cc6c954a authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull more device-mapper fixes from Alasdair G Kergon:
 "A fix for stacked dm thin devices and a fix for the new dm WRITE SAME
  support."

* tag 'dm-3.8-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-dm:
  dm: fix write same requests counting
  dm thin: fix queue limits stacking
parents cf5425bf fe7af2d3
Loading
Loading
Loading
Loading
+1 −12
Original line number Original line Diff line number Diff line
@@ -2746,19 +2746,9 @@ static int thin_iterate_devices(struct dm_target *ti,
	return 0;
	return 0;
}
}


/*
 * A thin device always inherits its queue limits from its pool.
 */
static void thin_io_hints(struct dm_target *ti, struct queue_limits *limits)
{
	struct thin_c *tc = ti->private;

	*limits = bdev_get_queue(tc->pool_dev->bdev)->limits;
}

static struct target_type thin_target = {
static struct target_type thin_target = {
	.name = "thin",
	.name = "thin",
	.version = {1, 6, 0},
	.version = {1, 7, 0},
	.module	= THIS_MODULE,
	.module	= THIS_MODULE,
	.ctr = thin_ctr,
	.ctr = thin_ctr,
	.dtr = thin_dtr,
	.dtr = thin_dtr,
@@ -2767,7 +2757,6 @@ static struct target_type thin_target = {
	.postsuspend = thin_postsuspend,
	.postsuspend = thin_postsuspend,
	.status = thin_status,
	.status = thin_status,
	.iterate_devices = thin_iterate_devices,
	.iterate_devices = thin_iterate_devices,
	.io_hints = thin_io_hints,
};
};


/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
+4 −2
Original line number Original line Diff line number Diff line
@@ -1188,6 +1188,7 @@ static int __clone_and_map_changing_extent_only(struct clone_info *ci,
{
{
	struct dm_target *ti;
	struct dm_target *ti;
	sector_t len;
	sector_t len;
	unsigned num_requests;


	do {
	do {
		ti = dm_table_find_target(ci->map, ci->sector);
		ti = dm_table_find_target(ci->map, ci->sector);
@@ -1200,7 +1201,8 @@ static int __clone_and_map_changing_extent_only(struct clone_info *ci,
		 * reconfiguration might also have changed that since the
		 * reconfiguration might also have changed that since the
		 * check was performed.
		 * check was performed.
		 */
		 */
		if (!get_num_requests || !get_num_requests(ti))
		num_requests = get_num_requests ? get_num_requests(ti) : 0;
		if (!num_requests)
			return -EOPNOTSUPP;
			return -EOPNOTSUPP;


		if (is_split_required && !is_split_required(ti))
		if (is_split_required && !is_split_required(ti))
@@ -1208,7 +1210,7 @@ static int __clone_and_map_changing_extent_only(struct clone_info *ci,
		else
		else
			len = min(ci->sector_count, max_io_len(ci->sector, ti));
			len = min(ci->sector_count, max_io_len(ci->sector, ti));


		__issue_target_requests(ci, ti, ti->num_discard_requests, len);
		__issue_target_requests(ci, ti, num_requests, len);


		ci->sector += len;
		ci->sector += len;
	} while (ci->sector_count -= len);
	} while (ci->sector_count -= len);