···472472473473static bool must_push_back_rq(struct multipath *m)474474{475475- return test_bit(MPATHF_QUEUE_IF_NO_PATH, &m->flags) || __must_push_back(m);475475+ unsigned long flags;476476+ bool ret;477477+478478+ spin_lock_irqsave(&m->lock, flags);479479+ ret = (test_bit(MPATHF_QUEUE_IF_NO_PATH, &m->flags) || __must_push_back(m));480480+ spin_unlock_irqrestore(&m->lock, flags);481481+482482+ return ret;476483}477484478485/*···16281621 if (pgpath)16291622 fail_path(pgpath);1630162316311631- if (!atomic_read(&m->nr_valid_paths)) {16321632- unsigned long flags;16331633- spin_lock_irqsave(&m->lock, flags);16341634- if (!must_push_back_rq(m)) {16351635- if (error == BLK_STS_IOERR)16361636- dm_report_EIO(m);16371637- /* complete with the original error */16381638- r = DM_ENDIO_DONE;16391639- }16401640- spin_unlock_irqrestore(&m->lock, flags);16241624+ if (!atomic_read(&m->nr_valid_paths) &&16251625+ !must_push_back_rq(m)) {16261626+ if (error == BLK_STS_IOERR)16271627+ dm_report_EIO(m);16281628+ /* complete with the original error */16291629+ r = DM_ENDIO_DONE;16411630 }16421631 }16431632