Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751318AbdFEFft (ORCPT ); Mon, 5 Jun 2017 01:35:49 -0400 Received: from verein.lst.de ([213.95.11.211]:38011 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751270AbdFEFfr (ORCPT ); Mon, 5 Jun 2017 01:35:47 -0400 Date: Mon, 5 Jun 2017 07:35:45 +0200 From: Christoph Hellwig To: Johannes Thumshirn Cc: Christoph Hellwig , Sagi Grimberg , Keith Busch , Hannes Reinecke , maxg@mellanox.com, Linux NVMe Mailinglist , Linux Kernel Mailinglist Subject: Re: [PATCH v4 3/8] nvmet: implement namespace identify descriptor list Message-ID: <20170605053545.GD19480@lst.de> References: <20170604103649.22130-1-jthumshirn@suse.de> <20170604103649.22130-4-jthumshirn@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170604103649.22130-4-jthumshirn@suse.de> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 717 Lines: 14 I think this needs to zero the remainder of the 4k buffer, quoting the spec: "The controller may return any number of variable length Namespace Identification Descriptor structures that fit into the 4096 byte Identify payload. All remaining bytes after the namespace identification descriptor structures should be cleared to 0h, and the host shall interpret a Namespace Identifier Descriptor Length (NIDL) value of 0h as the end of the list. If the hosts sees an unknown descriptor type it should continue parsing the structure." It could be easily done by copying the zero page to userspace. Eventually I want to add a helper to zero parts of a sglist to lib/scatterlist.c, but I don't want to burden that on you.