aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-raid1.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/dm-raid1.c')
-rw-r--r--drivers/md/dm-raid1.c29
1 files changed, 21 insertions, 8 deletions
diff --git a/drivers/md/dm-raid1.c b/drivers/md/dm-raid1.c
index 4e90f231fbfb..d12cf3e5e076 100644
--- a/drivers/md/dm-raid1.c
+++ b/drivers/md/dm-raid1.c
@@ -402,9 +402,21 @@ static void rh_dec(struct region_hash *rh, region_t region)
402 402
403 spin_lock_irqsave(&rh->region_lock, flags); 403 spin_lock_irqsave(&rh->region_lock, flags);
404 if (atomic_dec_and_test(&reg->pending)) { 404 if (atomic_dec_and_test(&reg->pending)) {
405 /*
406 * There is no pending I/O for this region.
407 * We can move the region to corresponding list for next action.
408 * At this point, the region is not yet connected to any list.
409 *
410 * If the state is RH_NOSYNC, the region should be kept off
411 * from clean list.
412 * The hash entry for RH_NOSYNC will remain in memory
413 * until the region is recovered or the map is reloaded.
414 */
415
416 /* do nothing for RH_NOSYNC */
405 if (reg->state == RH_RECOVERING) { 417 if (reg->state == RH_RECOVERING) {
406 list_add_tail(&reg->list, &rh->quiesced_regions); 418 list_add_tail(&reg->list, &rh->quiesced_regions);
407 } else { 419 } else if (reg->state == RH_DIRTY) {
408 reg->state = RH_CLEAN; 420 reg->state = RH_CLEAN;
409 list_add(&reg->list, &rh->clean_regions); 421 list_add(&reg->list, &rh->clean_regions);
410 } 422 }
@@ -922,9 +934,9 @@ static inline int _check_region_size(struct dm_target *ti, uint32_t size)
922static int get_mirror(struct mirror_set *ms, struct dm_target *ti, 934static int get_mirror(struct mirror_set *ms, struct dm_target *ti,
923 unsigned int mirror, char **argv) 935 unsigned int mirror, char **argv)
924{ 936{
925 sector_t offset; 937 unsigned long long offset;
926 938
927 if (sscanf(argv[1], SECTOR_FORMAT, &offset) != 1) { 939 if (sscanf(argv[1], "%llu", &offset) != 1) {
928 ti->error = "dm-mirror: Invalid offset"; 940 ti->error = "dm-mirror: Invalid offset";
929 return -EINVAL; 941 return -EINVAL;
930 } 942 }
@@ -1191,16 +1203,17 @@ static int mirror_status(struct dm_target *ti, status_type_t type,
1191 for (m = 0; m < ms->nr_mirrors; m++) 1203 for (m = 0; m < ms->nr_mirrors; m++)
1192 DMEMIT("%s ", ms->mirror[m].dev->name); 1204 DMEMIT("%s ", ms->mirror[m].dev->name);
1193 1205
1194 DMEMIT(SECTOR_FORMAT "/" SECTOR_FORMAT, 1206 DMEMIT("%llu/%llu",
1195 ms->rh.log->type->get_sync_count(ms->rh.log), 1207 (unsigned long long)ms->rh.log->type->
1196 ms->nr_regions); 1208 get_sync_count(ms->rh.log),
1209 (unsigned long long)ms->nr_regions);
1197 break; 1210 break;
1198 1211
1199 case STATUSTYPE_TABLE: 1212 case STATUSTYPE_TABLE:
1200 DMEMIT("%d ", ms->nr_mirrors); 1213 DMEMIT("%d ", ms->nr_mirrors);
1201 for (m = 0; m < ms->nr_mirrors; m++) 1214 for (m = 0; m < ms->nr_mirrors; m++)
1202 DMEMIT("%s " SECTOR_FORMAT " ", 1215 DMEMIT("%s %llu ", ms->mirror[m].dev->name,
1203 ms->mirror[m].dev->name, ms->mirror[m].offset); 1216 (unsigned long long)ms->mirror[m].offset);
1204 } 1217 }
1205 1218
1206 return 0; 1219 return 0;