Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp6340688pxu; Wed, 23 Dec 2020 22:44:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJw3XYD9NBjV90DFX+M0uirtWwvoeQBlQlO0sLIPrn958tdWAs102FxQ9bQsKzzFzbCBfAhF X-Received: by 2002:a17:906:358c:: with SMTP id o12mr20075404ejb.301.1608792270712; Wed, 23 Dec 2020 22:44:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608792270; cv=none; d=google.com; s=arc-20160816; b=QBL7mpIGlUwzY8MLGvj+eS8ASzhpXcFEq2YgSjpI9+KfGtV2YFQXLTJNEoICX/s8vE Os34TDc9YBzw1UTgH/y1ftdRXLhq7/Ke6pFwwzfELQqFt0Lrmt6m79+FAa9eyE7tzkMa SkcXGmi7YdDjp96OT6+tYxyK13/9nE9k0Zq7U5ou6UY3WfcSJdZ/AyjNkBl3S7ibXyYT cr3r1jsHy76SK8/L+MolKn5yMBZ25kTDjz4DP1mLX+3jkGfh9Pauh0Ainq/IBZHybKQm rKQ8Wuh50Do/D/Yk+b6B5j/lyRssQ0oSQcQddQIfC0y5Q36GI8EVcG6KFrqSrEgh/efh Pfeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=hgZ+lZNP3B/K9Oj/s5udXyrBDVF5xZJ71bYP1nixZdo=; b=W2afRO++By2kgjNmnTPxdJffzxAsyuK+RVRNHvXIRvUlZrfXFpfO3UcDSVRsorDDMj gWRwvOqLfigLP+zmzC0izAeGMDGhEzS7+EkS6V2KcvzZZB3vKwJ+SeC9Z73rborJi0Dv uCFBZr356IPFczcb6mXiF9UB3kZ49GNMA6j1B+BPuOeSv/5YQkJNXL5TwDj77jyRXxFp F+U/Jud6eOZGMpfhQUsIMhuPpzJLpOsFILan7aIe9iH3D5c12dGRqMaMCvDMYbVFeJ0+ h0b4jL4+1Xm3mVR4qxnIR3hNrt8K0QsLt/zFqQ6gxiBfDsMhlavI+OTcqWPEv04iyQLr Or7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=hzjxM2aG; 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 h19si12297849ejy.455.2020.12.23.22.44.08; Wed, 23 Dec 2020 22:44: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=@infradead.org header.s=casper.20170209 header.b=hzjxM2aG; 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 S1727114AbgLXGmJ (ORCPT + 99 others); Thu, 24 Dec 2020 01:42:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725613AbgLXGmI (ORCPT ); Thu, 24 Dec 2020 01:42:08 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69174C061794; Wed, 23 Dec 2020 22:41:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=hgZ+lZNP3B/K9Oj/s5udXyrBDVF5xZJ71bYP1nixZdo=; b=hzjxM2aGVedqOqTPaeLJKWYuY4 xkqiFVFpQKWkgqEySPTCLiSvWvcEJrgRLsJBOnrS0QZdfm4dsSOXZeO0PNLab6ggKCBq1lw6nS3kW Y3WaTFZ3ODCAIHwpPam/g5eYytVyG9hqXEC7GPEvByE+eg/g0kafrqgdDkSIVH2HW9VYEuJ8mRIkc w8qFJdvjTIWFM9bOal30Yib0rTy3vrCUR/hyI4lFqoeN/ROgowBMVqDPpJTNzgpcOcabaesZubCUI HkInEHpdkOK6FMxwC/PdZmtaPCsBloa68FjEumpKaKfc+q+vT15CVF5bXkEMkQSnUvd4YD+3SEbZo nG0RhV+w==; Received: from hch by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1ksKJL-0000uK-Pw; Thu, 24 Dec 2020 06:41:19 +0000 Date: Thu, 24 Dec 2020 06:41:19 +0000 From: Christoph Hellwig To: Pavel Begunkov Cc: dgilbert@interlog.com, James Bottomley , Christoph Hellwig , 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 Subject: Re: [PATCH v1 0/6] no-copy bvec Message-ID: <20201224064119.GA3048@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> <8abc56c2-4db8-5ee3-ab2d-8960d0eeeb0d@interlog.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 23, 2020 at 08:32:45PM +0000, Pavel Begunkov wrote: > On 23/12/2020 20:23, Douglas Gilbert wrote: > > On 2020-12-23 11:04 a.m., James Bottomley wrote: > >> 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. > > > > When using scatter gather lists at the far end (i.e. on the storage device) > > the T10 examples (WRITE SCATTERED and POPULATE TOKEN in SBC-4) explicitly > > allow the "number of logical blocks" in their sgl_s to be zero and state > > that it is _not_ to be considered an error. > > It's fine for my case unless it leaks them out of device driver to the > net/block layer/etc. Is it? None of the SCSI Command mentions above are supported by Linux, nevermind mapped to struct scatterlist.