Skip to content

Commit cc6c954

Browse files
committed
Merge tag 'dm-3.8-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-dm
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
2 parents cf5425b + fe7af2d commit cc6c954

File tree

2 files changed

+5
-14
lines changed

2 files changed

+5
-14
lines changed

drivers/md/dm-thin.c

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2746,19 +2746,9 @@ static int thin_iterate_devices(struct dm_target *ti,
27462746
return 0;
27472747
}
27482748

2749-
/*
2750-
* A thin device always inherits its queue limits from its pool.
2751-
*/
2752-
static void thin_io_hints(struct dm_target *ti, struct queue_limits *limits)
2753-
{
2754-
struct thin_c *tc = ti->private;
2755-
2756-
*limits = bdev_get_queue(tc->pool_dev->bdev)->limits;
2757-
}
2758-
27592749
static struct target_type thin_target = {
27602750
.name = "thin",
2761-
.version = {1, 6, 0},
2751+
.version = {1, 7, 0},
27622752
.module = THIS_MODULE,
27632753
.ctr = thin_ctr,
27642754
.dtr = thin_dtr,
@@ -2767,7 +2757,6 @@ static struct target_type thin_target = {
27672757
.postsuspend = thin_postsuspend,
27682758
.status = thin_status,
27692759
.iterate_devices = thin_iterate_devices,
2770-
.io_hints = thin_io_hints,
27712760
};
27722761

27732762
/*----------------------------------------------------------------*/

drivers/md/dm.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,6 +1188,7 @@ static int __clone_and_map_changing_extent_only(struct clone_info *ci,
11881188
{
11891189
struct dm_target *ti;
11901190
sector_t len;
1191+
unsigned num_requests;
11911192

11921193
do {
11931194
ti = dm_table_find_target(ci->map, ci->sector);
@@ -1200,15 +1201,16 @@ static int __clone_and_map_changing_extent_only(struct clone_info *ci,
12001201
* reconfiguration might also have changed that since the
12011202
* check was performed.
12021203
*/
1203-
if (!get_num_requests || !get_num_requests(ti))
1204+
num_requests = get_num_requests ? get_num_requests(ti) : 0;
1205+
if (!num_requests)
12041206
return -EOPNOTSUPP;
12051207

12061208
if (is_split_required && !is_split_required(ti))
12071209
len = min(ci->sector_count, max_io_len_target_boundary(ci->sector, ti));
12081210
else
12091211
len = min(ci->sector_count, max_io_len(ci->sector, ti));
12101212

1211-
__issue_target_requests(ci, ti, ti->num_discard_requests, len);
1213+
__issue_target_requests(ci, ti, num_requests, len);
12121214

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

0 commit comments

Comments
 (0)