Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp1036213ybf; Fri, 28 Feb 2020 12:36:02 -0800 (PST) X-Google-Smtp-Source: APXvYqwdZJXvKdKD98by7tqG2NPas7bONTdJRUE2Fi83rAebVnGRJiJ2yB3ezJvRpNFz3H9mghq2 X-Received: by 2002:aca:814:: with SMTP id 20mr4470586oii.159.1582922162037; Fri, 28 Feb 2020 12:36:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582922162; cv=none; d=google.com; s=arc-20160816; b=hcz//Hwu6IHPzMMY50h/nJT0xbU4ay+And99eK5vmy1M51GIPlUYjeB/d2eVfJVytM JfRJ+kI9yXAPFylUlNtG4GP3+HQRyykb5aKSaSaCtBmemcz7aaLOFY3o+hyrdJx+a8ph Z/fMoJUC1bX/T52QONT3e5obQP7c+S/HPbGDOOE+R415XmqzKJM0mgfLqk3Cqn3e3c08 gaStwWKC9JrnwbbRpi5PNaSSM/qeXdsbb4YWtIkU1Hk/S7BfIrsxb7kS/S2zcFBl/mxo FkynPR/S6uhHxV7h7vyFtrW2OmJZMRfXcYlvr5EdpZ29zO6rJy3258cw1xUe1yAlaOxx QpnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=97u/7NaTOp1KxJ+2qEOU5lIQr1rbfWY6Aa/x/LzHMzc=; b=AoXmZqnMEtUsQEfOxNAjAkinN9fNA4VM3sU9uRjI+NUSE3ganWYV3TDukwtIXhAraS 4A4kfoJyCYV3loopQQatkD0p7wXv7Ckl9sCEZcjw9RwHCioc32dxcGtoI7JOVWfEVvaV c58yrqu8i9Fo2b0Fg+4R0j7EiaaMXZ04K+J3HuLAT1I+B5K6vMzxPfn0wJHsgSgbuDyS FCPUtmmtVVCJbBHCUPT2KGcyG+U69fqAUCDd5g9bkRPYLdKLeCbz+yP2cPFs7pnbEXIU qHMXaedxTYQXB5grIr1LANx83TYm5rj3JjA5mur+hIU7Lx9+VksroVvYO0zYcBbKFUVE jzXQ== ARC-Authentication-Results: i=1; mx.google.com; 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 l21si2388608oic.126.2020.02.28.12.35.43; Fri, 28 Feb 2020 12:36:02 -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; 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 S1725769AbgB1Ufm (ORCPT + 99 others); Fri, 28 Feb 2020 15:35:42 -0500 Received: from mx2.suse.de ([195.135.220.15]:54530 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725730AbgB1Ufm (ORCPT ); Fri, 28 Feb 2020 15:35:42 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id CB895AE95; Fri, 28 Feb 2020 20:35:40 +0000 (UTC) Date: Fri, 28 Feb 2020 14:35:38 -0600 From: Goldwyn Rodrigues To: Matthew Wilcox 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: <20200228203538.s52t64zcurna77cu@fiona> References: <20200220152355.5ticlkptc7kwrifz@fiona> <20200221045110.612705204E@d06av21.portsmouth.uk.ibm.com> <20200225205342.GA12066@infradead.org> <20200228194401.o736qvvr4zpklyiz@fiona> <20200228195954.GJ29971@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200228195954.GJ29971@bombadil.infradead.org> User-Agent: NeoMutt/20180716 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On 11:59 28/02, Matthew Wilcox wrote: > 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. > Ah, okay. Now I understand what Christoph was saying. I suppose it is safe to remove iov_iter_reexpand(). I don't see any other goto to this label which will have a non-zero copied value. And we have already performed the iov_iter_revert(). -- Goldwyn