Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp2430311ybh; Fri, 24 Jul 2020 12:36:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxo5tTFs8v0iwfETa7MTXrw+kzlivuLQmH9eTDfrFK79EeR9nYptQiZOEnLz37RgZVre88y X-Received: by 2002:aa7:c314:: with SMTP id l20mr10841668edq.150.1595619389565; Fri, 24 Jul 2020 12:36:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595619389; cv=none; d=google.com; s=arc-20160816; b=MCjLRSCVrMzaRwcbcVNveoSGprF9gNZL0aZ2fVbKb8S7GxKkbJs8vKI6kCvt7ko44l QccFXFK94v60W8ya3zx9bcPpfl5/sGT2kpRONSFUgPgwC+EAEo6EV6oV4XT3Ow8ItCoU e6lC1bK3vKPBxRd0/Y7Uwv4UjOwBtehgAPordZD4UcoP5WaT2/CJHRJi09bmvb96Ua5Y wX1qopV0T+9KTEdFCQ+gkaY2pRNew4RnyTSXh8WYU19KevYY89rvoG2JDLPU7nxm3Gt3 TCIu/6MZ/EbN+1cJ3H5V04mxYm+WhbGb1JECewoBKXiYRi6DG/tbYr3HrFKlkWUD6EWR MXaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=wHLr2pVFsS94/yNR26Ce2uooTFYEZhfPFPm1qxhQfvM=; b=XZmgTpbK8iT9LdpTPUEZAvZqV1+KF6TrxplGNo3QPzVN7u+j7SANcfCrk/lUNYgL2/ 92akp3hHq/gcqw/QhTpZ+U1mq2d9fEc6n5L4Zrj7FOrXJQpPc8FWhHnPBbH9Z7sGsV9s x1kCWssM7AvYQBETaoccny8qTZkbvpMbVSsGECgICozyP1xsRN0F+0JmgIfKaiB1Ezmg ic0EyOeopceW2XDryl78wYS56xC/iWPF1Oa9W44GRyuvfEiPZfgYU7+pcvymsQWcYWTM FyzYeUEQL98n8nfBJsdUXFHysoUUxZqNtbgYFiXjTtF8UGG8AuXuQUBGy0IbMvknjJG/ tBRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yIvtZ+7q; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h16si1150870edr.390.2020.07.24.12.36.07; Fri, 24 Jul 2020 12:36:29 -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; dkim=pass header.i=@kernel.org header.s=default header.b=yIvtZ+7q; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726780AbgGXTdy (ORCPT + 99 others); Fri, 24 Jul 2020 15:33:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:52974 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726085AbgGXTdy (ORCPT ); Fri, 24 Jul 2020 15:33:54 -0400 Received: from dhcp-10-100-145-180.wdl.wdc.com (unknown [199.255.45.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3247E206F6; Fri, 24 Jul 2020 19:33:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595619233; bh=s5Pq4+FkzTO2HXeCm8z0SJMPOsSTRJlA1F4DZgLYN/Q=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=yIvtZ+7quaXQuQVKxcGyfJkgORWLVgyZEvgUt3L9Qy6wPKcv5JXSv9CJw8mX6rpPo ln7POMC62kiPDLQSOifNTEOSknHkwS89tW83OQrFMKfdPVVs/3Xxeqvl4VH6cpYRMX wIocWzdrKGQGThstNc0JvAKZYZ+QSpQZMf0R1L8w= Date: Fri, 24 Jul 2020 12:33:51 -0700 From: Keith Busch To: Logan Gunthorpe Cc: linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, Christoph Hellwig , Sagi Grimberg , Jens Axboe , Chaitanya Kulkarni , Max Gurtovoy , Stephen Bates Subject: Re: [PATCH v16 6/9] nvmet-passthru: Add passthru code to process commands Message-ID: <20200724193351.GA2857771@dhcp-10-100-145-180.wdl.wdc.com> References: <20200724172520.16318-1-logang@deltatee.com> <20200724172520.16318-7-logang@deltatee.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200724172520.16318-7-logang@deltatee.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 24, 2020 at 11:25:17AM -0600, Logan Gunthorpe wrote: > + /* > + * The passthru NVMe driver may have a limit on the number of segments > + * which depends on the host's memory fragementation. To solve this, > + * ensure mdts is limitted to the pages equal to the number of limited > + /* don't support fuse commands */ > + id->fuses = 0; If a host were to set a fuse, the target should return an Invalid Field error. Just to future-proof, rejecting commands with any flags set (other than SGL, which you handled in patch 1/9) is probably what should happen, like: > +u16 nvmet_parse_passthru_io_cmd(struct nvmet_req *req) > +{ if (req->cmd->common.flags & ~NVME_CMD_SGL_ALL) return NVME_SC_INVALID_FIELD; Or maybe we could obviate the need for 1/9 with something like: req->cmd->common.flags &= ~NVME_CMD_SGL_ALL; if (req->cmd->common.flags) return NVME_SC_INVALID_FIELD;