Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp246381pxf; Wed, 31 Mar 2021 23:22:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwIYbOYHaJLOxV6DFTnKli9L1TUyVEgnCJ/1vXG8YMQvmrpn1S00Vl7uxQbyKxhJW5Wt0K6 X-Received: by 2002:aa7:dc4e:: with SMTP id g14mr8192862edu.114.1617258177608; Wed, 31 Mar 2021 23:22:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617258177; cv=none; d=google.com; s=arc-20160816; b=gnlUH2PgoBgFsm53m2xJuvQccMMEGYwudAk+sNNop8Jo3VtMSsO/n9v8PSmavADKVM IF8DiECPZE6yjrULMYbRJbQIHMCecFvPFzNhQiHh3dENtK5M7StvdoxvOV2BKDQJrQSV 7lX5oLrRhukC4Km9TTrg6Z5qao51JyoiW5lXI9t1t04saCjvBVbIsqiqi/F/hDaeRFVn 4KdsrpeTVpoL7XfsfAcqZT/hXB55p2ZoYCD+y8iIxU12meSNpDjZezkw+Ey1eJEdp5Ps ldQhKSLL59PSGLuTFBNgeKPhn23LzAUJ56CBAUVt8qN9DT+hdVLxc/V0wjGMamGPec4z kZYA== 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=7Rzwf/3cVI44hff6fBPfRfeNAI/zs9mh5CMx/BhoczE=; b=eIPGf1+a04g6T70v+qur8hUKH3naMfSAX6lyjaMdEVEJr6f/1+RjpMXAG7j4ig+zj7 nww9U7y6X/4QaeKnlFj8JOpCzsJ/MZouAMKAfBIrBYjM+mazlig74cer52Un6iyj5+vs +dK/Z46+7Mz59yluOoBU78Hwtg/Lq4FH0OPswWVvOjGx0xdpmX9S5i5lXWfZIWhpnFyc j4rzsl2ixdJFCoZFMNs4spbPK5M3mkScZbVkB3wYiIfPSpOHxkpnqHbYHyYazUHXTBXk SbdLShf1IHhgp8drWqEjsn4gg0lNGcYmYnTKgvC4tRNhW0w9qOi4V34uNR5z+GmjavOo dtUg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g21si3265872edu.536.2021.03.31.23.22.35; Wed, 31 Mar 2021 23:22:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229459AbhDAGUs (ORCPT + 99 others); Thu, 1 Apr 2021 02:20:48 -0400 Received: from verein.lst.de ([213.95.11.211]:38287 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233227AbhDAGUf (ORCPT ); Thu, 1 Apr 2021 02:20:35 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 20EC268B05; Thu, 1 Apr 2021 08:20:32 +0200 (CEST) Date: Thu, 1 Apr 2021 08:20:31 +0200 From: Christoph Hellwig To: Sagi Grimberg Cc: "Ewan D. Milne" , Hannes Reinecke , Keith Busch , Daniel Wagner , linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, Jens Axboe , Christoph Hellwig Subject: Re: [PATCH v2] nvme-tcp: Check if request has started before processing it Message-ID: <20210401062031.GA25424@lst.de> References: <20210301175601.116405-1-dwagner@suse.de> <6b51a989-5551-e243-abda-5872411ec3ff@grimberg.me> <20210311094345.ogm2lxqfuszktuhp@beryllium.lan> <70af5b02-10c1-ab0b-1dfc-5906216871b4@grimberg.me> <2fc7a320c86f75507584453dd2fbd744de5c170d.camel@redhat.com> <20210330232813.GA1935968@dhcp-10-100-145-180.wdc.com> <5715ef78-eaf1-dcb6-c2a2-f4725e1a01c4@grimberg.me> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5715ef78-eaf1-dcb6-c2a2-f4725e1a01c4@grimberg.me> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 31, 2021 at 03:24:49PM -0700, Sagi Grimberg wrote: > >>> What we can do, though, is checking the 'state' field in the tcp >>> request, and only allow completions for commands which are in a state >>> allowing for completions. >>> >>> Let's see if I can whip up a patch. >> >> That would be great. BTW in the crash dump I am looking at now, it >> looks like pdu->command_id was zero in nvme_tcp_recv_data(), and >> blk_mq_tag_to_rq() returned a request struct that had not been used. >> So I think we do need to check that the tag was actually allocated. > > request tag can't be zero? I forget... Of course it can. But the reserved tags are before the normal tags, so 0 would be a reserved tag for nvme.