The 17-time Grand Slam champion had been caught cold at a previous French Open by a player ranked as low as the 23-year-old Bosnian, and Federer made sure that did not happen again as he advanced to the fourth round for the 11th straight year with a clinical 6-4, 6-3, 6-2 win Friday.
"I'd never played him before, he moves well, he's very quick. I didn't know him and I didn't know how he'd play on the key points," said Federer, who lost in the first round in Paris to the 88th-ranked Luis Horna 12 years ago.
"Mentally I'm not always as relaxed as people might think, there is so much at stake," Federer said.
The 33-year-old Federer, who is seeded second at the tournament, put on another aggressive and solid display, winning 24 points at the net and saving four of the five break points he faced.
Hehit a superb forehand passing shot to earn a match point and sealed it when Dzumhur sent a backhand into the net.
"Once I got the rhythm it got better and better, and I was able to play more freely and mix up the game," said Federer, who won his only French Open title in 2009 when he completed his career Grand Slam.
Federer will next be up against either 13th-seeded Gael Monfils or No. 21 seed Pablo Cuevas.
Stan Wawrinkaalso was dominant, as the eighth seed beat American Steve Johnson6-4, 6-3, 6-2 in just 1 hour 29 minutes.
Wawrinka hit eight aces, did not face a single break point, and broke Johnson's serve four times.
Meanwhile, 20th-seeded Richard Gasquet needed 32 minutes on Friday to complete a 3-6, 6-3, 6-1, 4-6, 6-1 win over Carlos Berlocq and advance to the third round after a battle that spanned over two days. The players were locked at two sets apiece when their match was stopped Thursday evening.
"My preparation will be shortened, but everything's fine for me, I'm physically well," said Gasquet, who will face 15th-seeded Kevin Anderson in his next match and has just one day to recover.
Although Wimbledon is still one month away, Nicolas Mahut is already playing like he's on grass as the Frenchman came to the net 104 times during his third-round match against countryman Gilles Simon.
The strategy, however, didn't work: the 12th-seeded Simon, who came to the net just 29 times and hugged the baseline, won 6-2, 6-7 (6), 6-7 (6), 6-3, 6-1.
Also, 74th-ranked Teymuraz Gabashvili equaled his best Grand Slam result, reaching the fourth round with a 6-4, 6-4, 6-4 defeat of Lukas Rosol.
The Associated Press contributed to this report.
Federer cruises into fourth round
Roger Federer beats Damir Dzumhur in straight sets to reach the fourth round at the French Open.