No need to recheck the condition when promoting the write lock in multipath_map(). --- diff/drivers/md/dm-mpath.c 2003-12-09 16:38:48.000000000 +0000 +++ source/drivers/md/dm-mpath.c 2003-12-17 11:05:01.000000000 +0000 @@ -591,7 +591,6 @@ struct multipath *m = (struct multipath *) ti->private; struct path *path; - retry: down_read(&m->path_lock); /* @@ -602,15 +601,15 @@ up_read(&m->path_lock); } else { - /* promote to write lock */ + /* + * Promote to write lock, there is no need to + * recheck the condition after getting the write + * lock, since choosing a new path twice is + * harmless, and only this thread will have hit + * a zero m->count. */ up_read(&m->path_lock); down_write(&m->path_lock); - if (m->current_path && atomic_read(&m->count)) { - up_write(&m->path_lock); - goto retry; - } - if (__choose_path(m)) { /* no paths */ up_write(&m->path_lock);