Edward Douglas is serving a life sentence for selling crack cocaine. He cannot go to church with his mother, a pastor in Chicago. He cannot take his grandchildren to the park. He dreams of working as a mechanic again.

It’s a possibility that seems increasingly likely.

Under bipartisan criminal justice legislation that won final approval by Congress on Thursday, Mr. Douglas, 55, could have his sentence reduced to less time than he has already served. He was convicted at a time when crack cocaine offenses were handled far more harshly than those involving powder cocaine.

The disparity, now widely viewed as scientifically unwarranted and racially discriminatory, prompted mandatory minimum sentences for a far smaller amount of crack, more common in black communities, than powder, more common among whites. Even the judge who presided over Mr. Douglas’s case says he believed the mandatory life sentence was unfair.

Tens of thousands of people were sentenced under the harsher mandatory minimums for crack. But the change that could help Mr. Douglas has been so long in coming that relatively few of them remain incarcerated. No more than 2,660 federal inmates will potentially be eligible for sentence reductions under the change, according to the United States Sentencing Commission. Almost nine in 10 of them are, like Mr. Douglas, black.