Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp5897886pxu; Wed, 23 Dec 2020 08:06:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJzkr9k7YmfrJQ7sgziFSaoF3P/+2Qs7ohT4kttBU6sxvLm1EWwbTx/nJnT2Jl6TXMzc9Tuv X-Received: by 2002:a17:906:5912:: with SMTP id h18mr24293496ejq.261.1608739590829; Wed, 23 Dec 2020 08:06:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608739590; cv=none; d=google.com; s=arc-20160816; b=qOVM7mDtNmEWIC6gXj95divt8NClpfRbIinSUgzNSAYq0IQPqiqoK0K4E8OK2jAMJ/ j3oHim1/bVOKeG1lAm9BeTIViLa4EB97XqusdwbkFFiw4JexyNxCAJtRycjW2/bNDRPg JMVk8KbSPRhu8+v4pI7O+4nf0e9uNZxpmV8Apz8vY4KrmSenzN6rY+SPC13+UAJv5Ut4 NiBfyhcRT6xj2dMaWeWlE6dLaqyZrsgx8Ful0aTrlPAZ23QoyT4jKcxq7ph9+WxcL3ct 9WIRVnedHMtZUsnBtE63TGq4CjY09RZzDqPCwMlbDEjvMbRvYylJsFNr3WyDXjOHwQPv Wjyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature:dkim-signature; bh=T+HW8R/JxnK+tQLzHIYpV5QgdCpJESzWjGQcvno2B6c=; b=Fh/dtoPwcELJtB/luBOP4xT4/GvxHl/Y2fuNvdoLvkrWsiXY1jzLtt2ap0XfulzTFR n0Drz0ltb2GP6IF4HsIi9mUyXNS9AIx33abCl/hiaR5Wr5eqRVW4xews01f6+SUcISPp F6Z8wvfvyh/K9HZS6td0r5iuoQiKbeY8hBswsdS+pfd8E+ZCOgu+2xWm0rEdlFPN88jG tz2mwfrolEJQsP4k+tzocJR8LEyRaJ5AdaeV6E13VqQNq2MisDTQLUtAzNXSIeAjDDRf gUvd0rWX+MRQWmpPNNk9TNTYdjqzsba//RkSkVEtf7OFFavWngLkm5aIcZr9/X+O0X7Q ggkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@hansenpartnership.com header.s=20151216 header.b=UOJqbOiP; dkim=pass header.i=@hansenpartnership.com header.s=20151216 header.b=UOJqbOiP; 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=hansenpartnership.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l11si13604418ejx.183.2020.12.23.08.06.08; Wed, 23 Dec 2020 08:06:30 -0800 (PST) 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=@hansenpartnership.com header.s=20151216 header.b=UOJqbOiP; dkim=pass header.i=@hansenpartnership.com header.s=20151216 header.b=UOJqbOiP; 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=hansenpartnership.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729277AbgLWQFE (ORCPT + 99 others); Wed, 23 Dec 2020 11:05:04 -0500 Received: from bedivere.hansenpartnership.com ([96.44.175.130]:34262 "EHLO bedivere.hansenpartnership.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727360AbgLWQFE (ORCPT ); Wed, 23 Dec 2020 11:05:04 -0500 Received: from localhost (localhost [127.0.0.1]) by bedivere.hansenpartnership.com (Postfix) with ESMTP id D32A412809AE; Wed, 23 Dec 2020 08:04:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=hansenpartnership.com; s=20151216; t=1608739463; bh=dzRbIAIFFOVOpKnDTOA6zj0KHef4324sFMv5xTBqMv8=; h=Message-ID:Subject:From:To:Date:In-Reply-To:References:From; b=UOJqbOiPCHjby5AESe5JFFEouYk+7tGM0MdXl1UUaO5WknQH6hP4It7J3GKxcEi95 Yte0Ppq4ypfucjFU3ZXlhSB3CzxVj/rcDo+FxKT5WH0PyxzP08G4QrDqX877Em71j9 QH2hzjXQGwyh49OWRTJ42Aqg9mNa9g8Tkf2ap8ls= Received: from bedivere.hansenpartnership.com ([127.0.0.1]) by localhost (bedivere.hansenpartnership.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id c3cuwwSOf488; Wed, 23 Dec 2020 08:04:23 -0800 (PST) Received: from jarvis.int.hansenpartnership.com (c-73-35-198-56.hsd1.wa.comcast.net [73.35.198.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bedivere.hansenpartnership.com (Postfix) with ESMTPSA id D1B9C12809AD; Wed, 23 Dec 2020 08:04:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=hansenpartnership.com; s=20151216; t=1608739463; bh=dzRbIAIFFOVOpKnDTOA6zj0KHef4324sFMv5xTBqMv8=; h=Message-ID:Subject:From:To:Date:In-Reply-To:References:From; b=UOJqbOiPCHjby5AESe5JFFEouYk+7tGM0MdXl1UUaO5WknQH6hP4It7J3GKxcEi95 Yte0Ppq4ypfucjFU3ZXlhSB3CzxVj/rcDo+FxKT5WH0PyxzP08G4QrDqX877Em71j9 QH2hzjXQGwyh49OWRTJ42Aqg9mNa9g8Tkf2ap8ls= Message-ID: Subject: Re: [PATCH v1 0/6] no-copy bvec From: James Bottomley To: Christoph Hellwig , Pavel Begunkov Cc: Ming Lei , linux-block@vger.kernel.org, Jens Axboe , Matthew Wilcox , Johannes Weiner , Alexander Viro , "Darrick J . Wong" , "Martin K . Petersen" , Jonathan Corbet , linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, io-uring@vger.kernel.org, linux-kernel@vger.kernel.org, target-devel@vger.kernel.org, linux-scsi@vger.kernel.org, linux-doc@vger.kernel.org Date: Wed, 23 Dec 2020 08:04:22 -0800 In-Reply-To: <20201223155145.GA5902@infradead.org> References: <20201215014114.GA1777020@T590> <103235c1-e7d0-0b55-65d0-013d1a09304e@gmail.com> <20201215120357.GA1798021@T590> <20201222141112.GE13079@infradead.org> <933030f0-e428-18fd-4668-68db4f14b976@gmail.com> <20201223155145.GA5902@infradead.org> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.4 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2020-12-23 at 15:51 +0000, Christoph Hellwig wrote: > On Wed, Dec 23, 2020 at 12:52:59PM +0000, Pavel Begunkov wrote: > > Can scatterlist have 0-len entries? Those are directly translated > > into bvecs, e.g. in nvme/target/io-cmd-file.c and > > target/target_core_file.c. I've audited most of others by this > > moment, they're fine. > > For block layer SGLs we should never see them, and for nvme neither. > I think the same is true for the SCSI target code, but please double > check. Right, no-one ever wants to see a 0-len scatter list entry. The reason is that every driver uses the sgl to program the device DMA engine in the way NVME does. a 0 length sgl would be a dangerous corner case: some DMA engines would ignore it and others would go haywire, so if we ever let a 0 length list down into the driver, they'd have to understand the corner case behaviour of their DMA engine and filter it accordingly, which is why we disallow them in the upper levels, since they're effective nops anyway. James