aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-crypt.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/dm-crypt.c')
-rw-r--r--drivers/md/dm-crypt.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
index 259e86f26549..61a590bb6241 100644
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -518,6 +518,7 @@ static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv)
518 char *ivopts; 518 char *ivopts;
519 unsigned int crypto_flags; 519 unsigned int crypto_flags;
520 unsigned int key_size; 520 unsigned int key_size;
521 unsigned long long tmpll;
521 522
522 if (argc != 5) { 523 if (argc != 5) {
523 ti->error = PFX "Not enough arguments"; 524 ti->error = PFX "Not enough arguments";
@@ -633,15 +634,17 @@ static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv)
633 goto bad5; 634 goto bad5;
634 } 635 }
635 636
636 if (sscanf(argv[2], SECTOR_FORMAT, &cc->iv_offset) != 1) { 637 if (sscanf(argv[2], "%llu", &tmpll) != 1) {
637 ti->error = PFX "Invalid iv_offset sector"; 638 ti->error = PFX "Invalid iv_offset sector";
638 goto bad5; 639 goto bad5;
639 } 640 }
641 cc->iv_offset = tmpll;
640 642
641 if (sscanf(argv[4], SECTOR_FORMAT, &cc->start) != 1) { 643 if (sscanf(argv[4], "%llu", &tmpll) != 1) {
642 ti->error = PFX "Invalid device sector"; 644 ti->error = PFX "Invalid device sector";
643 goto bad5; 645 goto bad5;
644 } 646 }
647 cc->start = tmpll;
645 648
646 if (dm_get_device(ti, argv[3], cc->start, ti->len, 649 if (dm_get_device(ti, argv[3], cc->start, ti->len,
647 dm_table_get_mode(ti->table), &cc->dev)) { 650 dm_table_get_mode(ti->table), &cc->dev)) {
@@ -885,8 +888,8 @@ static int crypt_status(struct dm_target *ti, status_type_t type,
885 result[sz++] = '-'; 888 result[sz++] = '-';
886 } 889 }
887 890
888 DMEMIT(" " SECTOR_FORMAT " %s " SECTOR_FORMAT, 891 DMEMIT(" %llu %s %llu", (unsigned long long)cc->iv_offset,
889 cc->iv_offset, cc->dev->name, cc->start); 892 cc->dev->name, (unsigned long long)cc->start);
890 break; 893 break;
891 } 894 }
892 return 0; 895 return 0;