summaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorMikulas Patocka <mpatocka@redhat.com>2019-04-29 14:57:21 +0200
committerMike Snitzer <snitzer@redhat.com>2019-05-07 16:05:12 -0400
commit4f43446ddff056df237a8ee9257ec94baeed909d (patch)
tree2bc2f3512d90feb0942ef6a7c77504ed89454d44 /drivers/md
parentd5027e0345c2f014e1328b53e8d86a293edf1caf (diff)
downloadlinux-4f43446ddff056df237a8ee9257ec94baeed909d.tar.bz2
dm integrity: allow large ranges to be described
Change n_sectors data type from unsigned to sector_t. Following commits will need to lock large ranges. Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/dm-integrity.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/md/dm-integrity.c b/drivers/md/dm-integrity.c
index ffd0d156c24e..0dcced588c42 100644
--- a/drivers/md/dm-integrity.c
+++ b/drivers/md/dm-integrity.c
@@ -246,7 +246,7 @@ struct dm_integrity_c {
struct dm_integrity_range {
sector_t logical_sector;
- unsigned n_sectors;
+ sector_t n_sectors;
bool waiting;
union {
struct rb_node node;
@@ -1695,7 +1695,7 @@ retry:
unsigned ws, we, range_sectors;
dio->range.n_sectors = min(dio->range.n_sectors,
- ic->free_sectors << ic->sb->log2_sectors_per_block);
+ (sector_t)ic->free_sectors << ic->sb->log2_sectors_per_block);
if (unlikely(!dio->range.n_sectors)) {
if (from_map)
goto offload_to_thread;
@@ -2153,7 +2153,7 @@ next_chunk:
get_area_and_offset(ic, range.logical_sector, &area, &offset);
range.n_sectors = min((sector_t)RECALC_SECTORS, ic->provided_data_sectors - range.logical_sector);
if (!ic->meta_dev)
- range.n_sectors = min(range.n_sectors, (1U << ic->sb->log2_interleave_sectors) - (unsigned)offset);
+ range.n_sectors = min(range.n_sectors, ((sector_t)1U << ic->sb->log2_interleave_sectors) - (unsigned)offset);
if (unlikely(!add_new_range(ic, &range, true)))
wait_and_add_new_range(ic, &range);