|
@@ -675,8 +675,10 @@ get_active_stripe(struct r5conf *conf, sector_t sector,
|
|
|| !conf->inactive_blocked),
|
|
|| !conf->inactive_blocked),
|
|
*(conf->hash_locks + hash));
|
|
*(conf->hash_locks + hash));
|
|
conf->inactive_blocked = 0;
|
|
conf->inactive_blocked = 0;
|
|
- } else
|
|
|
|
|
|
+ } else {
|
|
init_stripe(sh, sector, previous);
|
|
init_stripe(sh, sector, previous);
|
|
|
|
+ atomic_inc(&sh->count);
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
spin_lock(&conf->device_lock);
|
|
spin_lock(&conf->device_lock);
|
|
if (atomic_read(&sh->count)) {
|
|
if (atomic_read(&sh->count)) {
|
|
@@ -695,13 +697,11 @@ get_active_stripe(struct r5conf *conf, sector_t sector,
|
|
sh->group = NULL;
|
|
sh->group = NULL;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ atomic_inc(&sh->count);
|
|
spin_unlock(&conf->device_lock);
|
|
spin_unlock(&conf->device_lock);
|
|
}
|
|
}
|
|
} while (sh == NULL);
|
|
} while (sh == NULL);
|
|
|
|
|
|
- if (sh)
|
|
|
|
- atomic_inc(&sh->count);
|
|
|
|
-
|
|
|
|
spin_unlock_irq(conf->hash_locks + hash);
|
|
spin_unlock_irq(conf->hash_locks + hash);
|
|
return sh;
|
|
return sh;
|
|
}
|
|
}
|