Skip to contentSkip to conversation

Apply "nvme: Fix parsing of ANA log page" to 5.4

DISCUSSION Uday Shankar 2 participants 2 messages Feb 10, 2022 – Feb 11, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hello,

Please apply the patch "nvme: Fix parsing of ANA log page" to 5.4.

The commit ID in Linus's tree is:

	64fab7290dc3561729bbc1e35895a517eb2e549e

The patch was originally submitted on the linux-nvme mailing list, but for reasons unknown to me it never landed on 5.4 - this thread indicates it should have been accepted for 5.4.
https://lore.kernel.org/linux-nvme/[email protected]/T/#u

Without the patch, we perform the check

	WARN_ON_ONCE(offset > ctrl->ana_log_size - sizeof(*desc))

at the end of the enclosing loop. This check only makes sense if we are about to read another nvme_ana_group_desc from the ana_log_buf, but that's not the case at the end of the last iteration of the loop. In the last iteration, the warning fires and the function nvme_parse_ana_log fails. When nvme native multipath is enabled, this translates into failure to establish a connection to the controller.

The patch fixes the issue by moving the above check to a correct position within the loop body.

Thanks,
Uday Shankar

#1 lore raw
Quoted 21 lines · Uday Shankar

Hello,

Please apply the patch "nvme: Fix parsing of ANA log page" to 5.4.

The commit ID in Linus's tree is:

	64fab7290dc3561729bbc1e35895a517eb2e549e

The patch was originally submitted on the linux-nvme mailing list, but for reasons unknown to me it never landed on 5.4 - this thread indicates it should have been accepted for 5.4.
https://lore.kernel.org/linux-nvme/[email protected]/T/#u

Without the patch, we perform the check

	WARN_ON_ONCE(offset > ctrl->ana_log_size - sizeof(*desc))

at the end of the enclosing loop. This check only makes sense if we are about to read another nvme_ana_group_desc from the ana_log_buf, but that's not the case at the end of the last iteration of the loop. In the last iteration, the warning fires and the function nvme_parse_ana_log fails. When nvme native multipath is enabled, this translates into failure to establish a connection to the controller.

Quoted 2 lines

The patch fixes the issue by moving the above check to a correct position within the loop body.

Now queued up,t hanks.

greg k-h