Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7DF18C433EF for ; Fri, 11 Feb 2022 11:29:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232169AbiBKL3d (ORCPT ); Fri, 11 Feb 2022 06:29:33 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:47398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231152AbiBKL3c (ORCPT ); Fri, 11 Feb 2022 06:29:32 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0237CE5E for ; Fri, 11 Feb 2022 03:29:32 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id F1537B8286C for ; Fri, 11 Feb 2022 11:29:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5CE34C340E9; Fri, 11 Feb 2022 11:29:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644578967; bh=gjtiXdPMflT2FKkDJ9SNKjbTlX4vf8jg3WINRVHAhAA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=OLrMUDyPYQRe4is/ixcCvuJfnfXS8edGuL9lNVORcLjguadMhtRCn6mlobRM7Kmac FJoGUl9wRurv3mJuKSUQ3POZxLYT2vX/6pZ5Eb1pVJdA6912cEjWODr/MBcypk6G4K 4Fthy2nhZeWnKjIFW2905sXrHeKUB7MrGbpBBNI8= Date: Fri, 11 Feb 2022 12:29:25 +0100 From: Greg Kroah-Hartman To: Uday Shankar Cc: stable@vger.kernel.org, Prabhath Sajeepa , linux-nvme@lists.infradead.org, Sasha Levin Subject: Re: Apply "nvme: Fix parsing of ANA log page" to 5.4 Message-ID: References: <20220210001721.GA151884@dev-ushankar.dev.purestorage.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220210001721.GA151884@dev-ushankar.dev.purestorage.com> Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org On Wed, Feb 09, 2022 at 05:17:21PM -0700, Uday Shankar wrote: > 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/1572303408-37913-1-git-send-email-psajeepa@purestorage.com/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. Now queued up,t hanks. greg k-h