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.

dm: fix write same requests counting

When processing write same requests, fix dm to send the configured
number of WRITE SAME requests to the target rather than the number of
discards, which is not always the same.

Device-mapper WRITE SAME support was introduced by commit
23508a96cd2e857d57044a2ed7d305f2d9daf441 ("dm: add WRITE SAME support").

Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Acked-by: Mike Snitzer <snitzer@redhat.com>

+4 -2
+4 -2
drivers/md/dm.c
··· 1188 1188 { 1189 1189 struct dm_target *ti; 1190 1190 sector_t len; 1191 + unsigned num_requests; 1191 1192 1192 1193 do { 1193 1194 ti = dm_table_find_target(ci->map, ci->sector); ··· 1201 1200 * reconfiguration might also have changed that since the 1202 1201 * check was performed. 1203 1202 */ 1204 - if (!get_num_requests || !get_num_requests(ti)) 1203 + num_requests = get_num_requests ? get_num_requests(ti) : 0; 1204 + if (!num_requests) 1205 1205 return -EOPNOTSUPP; 1206 1206 1207 1207 if (is_split_required && !is_split_required(ti)) ··· 1210 1208 else 1211 1209 len = min(ci->sector_count, max_io_len(ci->sector, ti)); 1212 1210 1213 - __issue_target_requests(ci, ti, ti->num_discard_requests, len); 1211 + __issue_target_requests(ci, ti, num_requests, len); 1214 1212 1215 1213 ci->sector += len; 1216 1214 } while (ci->sector_count -= len);