From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 928A3C2BA4C for ; Wed, 26 Jan 2022 16:37:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243167AbiAZQhe (ORCPT ); Wed, 26 Jan 2022 11:37:34 -0500 Received: from verein.lst.de ([213.95.11.211]:40700 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243168AbiAZQhb (ORCPT ); Wed, 26 Jan 2022 11:37:31 -0500 Received: by verein.lst.de (Postfix, from userid 2407) id 500F768AFE; Wed, 26 Jan 2022 17:37:28 +0100 (CET) Date: Wed, 26 Jan 2022 17:37:28 +0100 From: Christoph Hellwig To: Ming Lei Cc: Christoph Hellwig , Jens Axboe , "Martin K . Petersen" , linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org Subject: Re: [PATCH V2 05/13] block: only account passthrough IO from userspace Message-ID: <20220126163728.GA31935@lst.de> References: <20220125061634.GA26495@lst.de> <20220125071906.GA27674@lst.de> <20220126055003.GA21089@lst.de> <20220126081052.GA23154@lst.de> <20220126084950.GA23957@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org On Wed, Jan 26, 2022 at 05:59:08PM +0800, Ming Lei wrote: > nvme just sets part0 to rq->bio, which is fine since nvme doesn't > support partial completion. > > The simplest way could be to assign bio->bi_bdev with q->disk->part0 in both > bio_copy_user_iov() and bio_map_user_iov(), which should cover most of cases. > Given user io is always on device instead of partition even though the > command is sent via partition bdev. This would be easiest, but it would also assign them when called from the SG driver. And that means these I/Os could be in flight when detaching a SCSI ULP. At least without the freeze in del_gendisk (or the local one in case of the sd driver).