Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp4840245rwb; Mon, 31 Jul 2023 13:09:35 -0700 (PDT) X-Google-Smtp-Source: APBJJlHItKvNDYOIqbhUU0xyCBF0BtYKp71eJxyy0pq6EWwe+kyLz0Jr39pIqjIOg/l7pDTFwEdI X-Received: by 2002:a17:907:a073:b0:978:928:3b99 with SMTP id ia19-20020a170907a07300b0097809283b99mr631502ejc.46.1690834175654; Mon, 31 Jul 2023 13:09:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690834175; cv=none; d=google.com; s=arc-20160816; b=0IGYbm6dWamx++Xhw4pbpieqZG1ru9N8BjlPksh/ifHnMESnAFO8CPC5Ergo2etUeK axaNBdzrztP2XtYHVHBLGjLrxAgYWnydxt79ZKccnIpjViNzHgLSMY2Nm9ysbqmgcEP+ tHymmt9EpJx7+us/ARLutRxvZDlwNjgtH/7ZWeEbyUk0JYBa4NQbFk308VB5NHpP14kk et+KQL5ouIGv2OpxmQOq/WRN/7kHhlWqLXFcVkLhIDQrWH+IgY4VjcMcAJB8wy+/lnsV dDoHE6iuNloZhxnJTwPKxwROLZfs7h1Kkhx7uv4YRYonrHAgoV2hAn8WAibqBksPP1cn o81A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=JBVg7mizuBxOl6a2ishwmxoxtro78UC5qu8BSXa1jFU=; fh=5CoC+7OM0kuNl1oKFLrkFvQcL3OiwXurUQb5tJltnmQ=; b=xvG1bxTfjibBD8xF1NJrZVbF5asLHkzDKGEGXGyy9hmuH7mXR/dO6wLQp6gNk81iIg y7DdbHZtyWZVxUmJPaplpcX4n5svdW6pkL9ZiMMII9QCfQGmN+sWMfkwyix9nSaRk+di Onj9zqqgkfXfATv2mPzypdi4hk3b08lYeVJa+IoFttp2XZ0O2FI9bu/T7VW48kYgSIjm 9eNAJ/fkaEFsxlg9jysF+vyAUeJEi0lrZCbq3CcllP8f4IYduep5bw4B9kmNx1vjyNP5 FYzde8Fo83Qh1gZlMVdNvujdHStRHKPouhRju0Hd6wetvoLvmY4O+EsPtY7qCphk57ol 9A4g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ay21-20020a170906d29500b0098cda9c19f0si7265931ejb.762.2023.07.31.13.09.10; Mon, 31 Jul 2023 13:09:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230269AbjGaTlm (ORCPT + 99 others); Mon, 31 Jul 2023 15:41:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229673AbjGaTlj (ORCPT ); Mon, 31 Jul 2023 15:41:39 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 993F9199F for ; Mon, 31 Jul 2023 12:41:11 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id 9F64968AA6; Mon, 31 Jul 2023 21:41:07 +0200 (CEST) Date: Mon, 31 Jul 2023 21:41:07 +0200 From: Christoph Hellwig To: Keith Busch Cc: Mario Limonciello , axboe@fb.com, hch@lst.de, sagi@grimberg.me, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, nilskruse97@gmail.com, git@augustwikerfors.se, David.Chang@amd.com Subject: Re: [PATCH] nvme: Don't fail to resume if NSIDs change Message-ID: <20230731194107.GA13620@lst.de> References: <20230731185103.18436-1-mario.limonciello@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 31, 2023 at 01:10:11PM -0600, Keith Busch wrote: > > As the check has been relaxed at startup for multiple disks with > > duplicate NSIDs with commit ac522fc6c3165 ("nvme: don't reject > > probe due to duplicate IDs for single-ported PCIe devices") also > > relax the check that runs on resume for NSIDs and mark them bogus > > if this occurs on resume. > > How could the driver tell the difference between the device needing a > quirk compared to a rapid delete-create-attach namespace sequence? > Proceeding with the namespace now may get dirty writes intended for the > previous namespace, corrupting the new one. > > The commit you mentioned tries to constrain allowing duplication where > we can reasonably assume the quirk is needed. If we need to do similiar > for this condition, one possible constraint might be that the device > doesn't report OACS bit 3 (Namespace Management). Yes, this patch as-is looks really dangerous. I don't think we should just ignore the fact that IDs change when queried again.