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 picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 38210EB64DA for ; Fri, 14 Jul 2023 13:17:08 +0000 (UTC) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id C98BE3CDE8A for ; Fri, 14 Jul 2023 15:17:05 +0200 (CEST) Received: from in-5.smtp.seeweb.it (in-5.smtp.seeweb.it [217.194.8.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by picard.linux.it (Postfix) with ESMTPS id 980A13CDE9C for ; Thu, 13 Jul 2023 17:56:35 +0200 (CEST) Received: from verein.lst.de (verein.lst.de [213.95.11.211]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by in-5.smtp.seeweb.it (Postfix) with ESMTPS id 29FCF600A4D for ; Thu, 13 Jul 2023 17:56:34 +0200 (CEST) Received: by verein.lst.de (Postfix, from userid 2407) id AC4A86732D; Thu, 13 Jul 2023 17:56:31 +0200 (CEST) Date: Thu, 13 Jul 2023 17:56:31 +0200 From: Christoph Hellwig To: Cyril Hrubis Message-ID: <20230713155631.GA29281@lst.de> References: <202307132107.2ce4ea2f-oliver.sang@intel.com> <20230713150923.GA28246@lst.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) X-Virus-Scanned: clamav-milter 1.0.1 at in-5.smtp.seeweb.it X-Virus-Status: Clean X-Mailman-Approved-At: Fri, 14 Jul 2023 15:16:55 +0200 Subject: Re: [LTP] [linus:master] [iomap] 219580eea1: ltp.writev07.fail X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Darrick J. Wong" , Christoph Hellwig , Andreas Gruenbacher , Miklos Szeredi , Matthew Wilcox , cluster-devel@redhat.com, Ilya Dryomov , Miklos Szeredi , Chao Yu , oe-lkp@lists.linux.dev, Al Viro , Jaegeuk Kim , Xiubo Li , Trond Myklebust , ltp@lists.linux.it, lkp@intel.com, Jens Axboe , Christian Brauner , Theodore Ts'o , Johannes Thumshirn , linux-kernel@vger.kernel.org, linux-xfs@vger.kernel.org, kernel test robot , Anna Schumaker , linux-fsdevel@vger.kernel.org, Andrew Morton , Hannes Reinecke Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ltp-bounces+ltp=archiver.kernel.org@lists.linux.it Sender: "ltp" On Thu, Jul 13, 2023 at 05:34:55PM +0200, Cyril Hrubis wrote: > iter.processed = iomap_write_iter(&iter, i); > > + iocb->ki_pos += iter.pos - iocb->ki_pos; > + > if (unlikely(ret < 0)) > return ret; > - ret = iter.pos - iocb->ki_pos; > - iocb->ki_pos += ret; > - return ret; > + > + return iter.pos - iocb->ki_pos; I don't think this works, as iocb->ki_pos has been updated above. What you want is probably the version below. But so far I can't reproduce anything yet.. diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c index adb92cdb24b009..02aea0174ddbcf 100644 --- a/fs/iomap/buffered-io.c +++ b/fs/iomap/buffered-io.c @@ -872,7 +872,7 @@ iomap_file_buffered_write(struct kiocb *iocb, struct iov_iter *i, while ((ret = iomap_iter(&iter, ops)) > 0) iter.processed = iomap_write_iter(&iter, i); - if (unlikely(ret < 0)) + if (iter.pos == iocb->ki_pos) return ret; ret = iter.pos - iocb->ki_pos; iocb->ki_pos += ret; -- Mailing list info: https://lists.linux.it/listinfo/ltp