aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-round-robin.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/dm-round-robin.c')
-rw-r--r--drivers/md/dm-round-robin.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/md/dm-round-robin.c b/drivers/md/dm-round-robin.c
index 4ace1da17db8..6c25213ab38c 100644
--- a/drivers/md/dm-round-robin.c
+++ b/drivers/md/dm-round-robin.c
@@ -210,14 +210,17 @@ static struct dm_path *rr_select_path(struct path_selector *ps, size_t nr_bytes)
210 struct path_info *pi = NULL; 210 struct path_info *pi = NULL;
211 struct dm_path *current_path = NULL; 211 struct dm_path *current_path = NULL;
212 212
213 local_irq_save(flags);
213 current_path = *this_cpu_ptr(s->current_path); 214 current_path = *this_cpu_ptr(s->current_path);
214 if (current_path) { 215 if (current_path) {
215 percpu_counter_dec(&s->repeat_count); 216 percpu_counter_dec(&s->repeat_count);
216 if (percpu_counter_read_positive(&s->repeat_count) > 0) 217 if (percpu_counter_read_positive(&s->repeat_count) > 0) {
218 local_irq_restore(flags);
217 return current_path; 219 return current_path;
220 }
218 } 221 }
219 222
220 spin_lock_irqsave(&s->lock, flags); 223 spin_lock(&s->lock);
221 if (!list_empty(&s->valid_paths)) { 224 if (!list_empty(&s->valid_paths)) {
222 pi = list_entry(s->valid_paths.next, struct path_info, list); 225 pi = list_entry(s->valid_paths.next, struct path_info, list);
223 list_move_tail(&pi->list, &s->valid_paths); 226 list_move_tail(&pi->list, &s->valid_paths);