Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp1009011ybf; Fri, 28 Feb 2020 12:01:13 -0800 (PST) X-Google-Smtp-Source: APXvYqxCFTnjgMrrVt10jQa27vdt9TYookfEQad2LI0Qz/fSERn3mQm4SiJBhWCPLSz/DDnd+jH9 X-Received: by 2002:a05:6808:6cd:: with SMTP id m13mr4293304oih.53.1582920073497; Fri, 28 Feb 2020 12:01:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582920073; cv=none; d=google.com; s=arc-20160816; b=M0XaLCqBMuY/NlgKpUnWMtARH8b+l3eyuKdaeN4gdQup6L+9goFrsHjzL3xfEz5s/v i/jMEIyxy+95X2IaBeScACYGqy6qh9wP5QcLAjPLHUlIJ271pSuFThAeY0BYctMswu91 d9Pv1H/OUYbRN+git2m0qPwUHbLf8DBNwH7xerGXkeRAXQbg5VBPzwp/lT6QpXT2ZaQ2 qphJcvmVl/Xx9otDVHdptcAZNpvMBO1OOq5gwRCsrfF5C7+K63P2EKB9cR1FOJ//Zi63 zq94NQLNOmR3k4Amnn1MmmT4j64Lfk6GFeXuGLYfglQmW+nXs9dRsXFVVQAIxJ/W737m E2nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=xY8PKVfaI12cjGthFIErDX+1jB0/adgnMfS1LHlHQYY=; b=DhZ/DWZJrNmy+M870HzF1LiZE5lVtz3kFzRocO5DNpQdPdOESrVUoovWDlRAKxh/J9 y1Im0uqj/pawOWtbcBbseQ7/p/h+NYko9RP0pA9BqEE3ExKnpzYmHaMEsW2rU7V3d0A7 DYK7s/HxMsRneql5+ZzIj2GcDpZondUFZAtgcMq8VB7Y3N5EndTdaUH2UgL7sM2eTYxp Vo4ite8MGHnyq4KrGuMTxUs7IRg4i1Hno6PXF+JS8DGJvv33/QAQXIvXM0a5hiXPnGgX aOgWTHZEVrnvpOF3ZZqC/nc0UeNrZb0nSp8WPfJVI1bmLR18TsU/zvub5AOrQApBdyo7 xFsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=fKw+M+IH; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y24si2387215oih.24.2020.02.28.12.00.57; Fri, 28 Feb 2020 12:01:13 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=fKw+M+IH; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726892AbgB1T74 (ORCPT + 99 others); Fri, 28 Feb 2020 14:59:56 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:46558 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725769AbgB1T74 (ORCPT ); Fri, 28 Feb 2020 14:59:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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=xY8PKVfaI12cjGthFIErDX+1jB0/adgnMfS1LHlHQYY=; b=fKw+M+IHRBrPRjZvU4H43ipERs 60IJF3gBEXe9m6cyMBAB6C72c271LTysvqXbfPeDE/sEmchtoAHyNWEdfKHqJsONNLn+xeej9II3u Ss9iE+sSJ3o5F0HYaJ6szarp7/WIUA8gkNN4VIFb31rC/PY2c2Y0Rp0kdslZRPnWLJUZAOkES8rU9 uN2z2jVfq22ledVbmZ+2cc9TgHvRgMIFEfs9mmUGg+CH7vamZqNtTnP9FJftzPbiBqIkn5c4c72yv 7JLZGc2d/5Gig0E40gsbzIDbukM837OPc3Lle+xozLSboNAO+I4mZMAqQ5giKbSHCwTv48kGxZ9aZ 2PPE9TXA==; Received: from willy by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1j7lne-0004W7-NN; Fri, 28 Feb 2020 19:59:54 +0000 Date: Fri, 28 Feb 2020 11:59:54 -0800 From: Matthew Wilcox To: Goldwyn Rodrigues Cc: Christoph Hellwig , Ritesh Harjani , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, darrick.wong@oracle.com Subject: Re: [PATCH v2] iomap: return partial I/O count on error in iomap_dio_bio_actor Message-ID: <20200228195954.GJ29971@bombadil.infradead.org> References: <20200220152355.5ticlkptc7kwrifz@fiona> <20200221045110.612705204E@d06av21.portsmouth.uk.ibm.com> <20200225205342.GA12066@infradead.org> <20200228194401.o736qvvr4zpklyiz@fiona> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200228194401.o736qvvr4zpklyiz@fiona> Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Fri, Feb 28, 2020 at 01:44:01PM -0600, Goldwyn Rodrigues wrote: > +++ b/fs/iomap/direct-io.c > @@ -264,7 +264,7 @@ iomap_dio_bio_actor(struct inode *inode, loff_t pos, loff_t length, > size_t n; > if (dio->error) { > iov_iter_revert(dio->submit.iter, copied); > - copied = ret = 0; > + ret = 0; > goto out; There's another change here ... look at the out label out: /* Undo iter limitation to current extent */ iov_iter_reexpand(dio->submit.iter, orig_count - copied); if (copied) return copied; return ret; so you're also changing by how much the iter is reexpanded. I don't know if it's the appropriate amount; I still don't quite get the iov_iter complexities.