Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp739930pxb; Fri, 3 Sep 2021 12:19:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwaBiauVEVA99MgzeupzfDLE9yivt7yOrU+UhCpNnjPIspTnsgi3LPzQ3iShpQimbjtVFtz X-Received: by 2002:a6b:7519:: with SMTP id l25mr373072ioh.169.1630696766140; Fri, 03 Sep 2021 12:19:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630696766; cv=none; d=google.com; s=arc-20160816; b=kC5Y1kxzUBcYu5jjNiorn9svYZF2t/tIpf2PCcezYAJQHkA6OhSB/O1CgWA/DW+usU iB+wKYn69tnSww05sJKYCMEGj6+8LznuizUsMnm/cpQjfACXQ2323dYAVMPIXIrX8hjI z7QKuW+Ul6Z5hJEvZNdBB+gEFrwxlxU5bNVdcyrxpyfHJ1lY9hOLlBBfW9saf6lW9U/1 G9dikx8h5rex2ddYJkfGsYxyFV4V6EMC5WvsDh+nqlIUa0skfuM2pGhhBA/p/EohbhIO N6tAtBptpxnw4h1d0Z1ij91rwSgTaiOh8B5yqtlwczI2iPfQ/GM8XPP2L5v8c/IgOZnj 9ROQ== 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=sISvEBp0wLaANLZsprSlLYMgEWroLLOQD40g6xNnMRg=; b=0Hy3Ss3o+pzXryyoJITuqrBK4t9KBQdLEm4pAHI592e9mgLiXYanSJhlteDQFXcrX/ 7W5hGVxwtaS8i3RK3DMDGNh9YatZuVLII2DY6ma87a6/6AifWiPBv6dyi9VAIboJ4O1w mSCfRyAIfhDxEoHLla2i9MKcNMiGHV9R6092uIqKKOtVNuYQ2IaU5IBg+m58a5y4HnMq fZZt1uDSu7iH/AJaRVbkxuylzRFhbCwxmssoQeSTLVRU/fcM7UFT4PbuL0t5SLQcm5I8 4rOKkxN6lCbViPXWAxBzBT1vLQCN1GiN+ZJiBnNHpExYqP/zAZpZe6vaYB20ghXAxQrv B64w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=d7eoWV5O; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j2si152502ilr.113.2021.09.03.12.19.13; Fri, 03 Sep 2021 12:19:26 -0700 (PDT) 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=@kernel.org header.s=k20201202 header.b=d7eoWV5O; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350875AbhICSs7 (ORCPT + 99 others); Fri, 3 Sep 2021 14:48:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:41332 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350567AbhICSs4 (ORCPT ); Fri, 3 Sep 2021 14:48:56 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 779DE610A1; Fri, 3 Sep 2021 18:47:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1630694876; bh=hT4RRpDObCrnqrIR/+8EtNZkR2fPesdsprcdlGFcdQg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=d7eoWV5Oc+mxNeU6xDgBsGQXlSQp4DrBk03yqy+9FA7qDJ7qtKDz6KS/G9mrZwmv5 3mlCxWPFaj+ELLcLcfZnPYK5VPpr0Y8+n3w8EcuZgo6E5M/ge+iuTSGdKYeK8dUUt4 aIs15/N269kT5ZvU6wgJtijOORJX/rqXc6BPOTLHWkYf2fUtD0Eb1Pj9y+NjM3sl5j 4+36lDXfsFf58nMQ3TBuMJWqXhEOREZPYbz98il2a/Fa4eOLui3gH8amHRcEb5mLnh O8rofMu+3Mw3WI/bsNbuJ5fsZYIvt/efcLvhqR955Ay85aXvZOrIZ+l9Uw6HTMF30O sP2xlMHsEr88A== Date: Fri, 3 Sep 2021 11:47:55 -0700 From: "Darrick J. Wong" To: Linus Torvalds Cc: Andreas Gruenbacher , Alexander Viro , Christoph Hellwig , Jan Kara , Matthew Wilcox , cluster-devel , linux-fsdevel , LKML , ocfs2-devel@oss.oracle.com Subject: Re: [PATCH v7 16/19] iomap: Add done_before argument to iomap_dio_rw Message-ID: <20210903184755.GC9892@magnolia> References: <20210827164926.1726765-1-agruenba@redhat.com> <20210827164926.1726765-17-agruenba@redhat.com> <20210827183018.GJ12664@magnolia> <20210827213239.GH12597@magnolia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 27, 2021 at 03:35:06PM -0700, Linus Torvalds wrote: > On Fri, Aug 27, 2021 at 2:32 PM Darrick J. Wong wrote: > > > > No, because you totally ignored the second question: > > > > If the directio operation succeeds even partially and the PARTIAL flag > > is set, won't that push the iov iter ahead by however many bytes > > completed? > > > > We already finished the IO for the first page, so the second attempt > > should pick up where it left off, i.e. the second page. > > Darrick, I think you're missing the point. > > It's the *return*value* that is the issue, not the iovec. > > The iovec is updated as you say. But the return value from the async > part is - without Andreas' patch - only the async part of it. > > With Andreas' patch, the async part will now return the full return > value, including the part that was done synchronously. > > And the return value is returned from that async part, which somehow > thus needs to know what predated it. Aha, that was the missing piece, thank you. I'd forgotten that iomap_dio_complete_work calls iocb->ki_complete with the return value of iomap_dio_complete, which means that the iomap_dio has to know if there was a previous transfer that stopped short so that the caller could do more work and resubmit. > Could that pre-existing part perhaps be saved somewhere else? Very > possibly. That 'struct iomap_dio' addition is kind of ugly. So maybe > what Andreas did could be done differently. There's probably a more elegant way for the ->ki_complete functions to figure out how much got transferred, but that's sufficiently ugly and invasive so as not to be suitable for a bug fix. > But I think you guys are arguing past each other. Yes, definitely. --D > > Linus