From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756824AbcDGPxe (ORCPT ); Thu, 7 Apr 2016 11:53:34 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:37215 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756074AbcDGPxc (ORCPT ); Thu, 7 Apr 2016 11:53:32 -0400 Date: Thu, 7 Apr 2016 08:53:29 -0700 From: Christoph Hellwig To: Al Viro Cc: Christoph Hellwig , Jens Axboe , linux-kernel@vger.kernel.org, linux-block@vger.kernel.org Subject: Re: [RFC] weird semantics of SG_DXFER_TO_FROM_DEV in BLK_DEV_SKD (drivers/block/skd*) Message-ID: <20160407155329.GA8703@infradead.org> References: <20160404033845.GE17997@ZenIV.linux.org.uk> <20160404065220.GA9447@infradead.org> <20160404171611.GF17997@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160404171611.GF17997@ZenIV.linux.org.uk> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 04, 2016 at 06:16:12PM +0100, Al Viro wrote: > Another fun question: should the normal sg_io() copy the buffer in on > SG_DXFER_TO_FROM_DEV? Right now it doesn't; in !copy case (when it goes > through bio_map_user_iov()) the effect is achieved simply by doing the > read into the pages user has mapped in that area, but bio_copy_user_iov() > doesn't do it: > /* > * success > */ > if (((iter->type & WRITE) && (!map_data || !map_data->null_mapped)) || > (map_data && map_data->from_user)) { > ret = bio_copy_from_iter(bio, *iter); > if (ret) > goto cleanup; > } > will see NULL map_data; the ->from_user case is sg_start_req() stuff. IOW, > SG_IO behaviour for /dev/sg* is different from the generic one... meh. I really wish /dev/sg was just using the generic page pool :(