Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp1333456rwp; Thu, 13 Jul 2023 09:17:12 -0700 (PDT) X-Google-Smtp-Source: APBJJlFgVeV/Gt4KjXendE5eX3QGXy3uUQhJSqM0bSXXmQDqncm+280vfWqhl/UcsBbNVOmLkXkf X-Received: by 2002:a17:906:5195:b0:992:1653:3416 with SMTP id y21-20020a170906519500b0099216533416mr2305195ejk.0.1689265031988; Thu, 13 Jul 2023 09:17:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689265031; cv=none; d=google.com; s=arc-20160816; b=WIqz/lTUL3ocVWUbdOunfhMXckcqr3qaJtchamD/5WbNNs3qbFX4UHQc/Dq23F0isB RFIaSqWj/F6Ww49ObSpu4R6kAhKouGSpLT3CrBXln08v6THAh2nZ5+AM532tcorPSWbh HvhHc1CBrYKBR7GyLQzYKqHQ9ZX+9WTgCkz6KvqPgQjP5mxvbKQKrjKWiJnJqYgnXgIu mqK5MlKoCS3XeYbvHmr3TZmZPcDdwAFDH40XuFUwGJ8Q1JuIvPM0dkbAnJ51d0Uz1nqB zAONa+YMuhohAi2vzEMULhjtqCg9ZyuCvNvUUE/ln3PhNPFH5FzRB0zIAtbVehISFz4Q gqJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=++WXYeXpyNvC2a4FnzOUlKJJhfqf/XKZGJ778A0ecjo=; fh=c5ikE74b1TGqTCWxa+NHcIEsOKq8NmYVJkaY99dv3+w=; b=wwFCZ5UPXzDrTKyKrkHdfbtDsMmYAyLIvhbNllSN3sf1qg0QRckrXVNE6NAwvUMWEF UEqSFMH+zydb+TnUavN4C/fT1hGEI9tP5DJOWDLcupGfMpuL/PfZ5INSXY5MHCOXwFlc 60VDVsurK1nBJiJDXx8fDVux6iiJ/Daer3HrEMB1L338A3lgYOpuasGLs31pa9F0a6/Q PcM20yU/VO+y2lZ52oeGY4PIQnVcPglgTXboIAu3+PTnHxFwBPFQl0t+B62f1zJ1NViT UAP97ekDEi4dLHqPEkuRZWdYBryA6E1LfbJfWvREuACW/sNuz1cVQYY8uND40ym4scBT VDWQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jt15-20020a170906dfcf00b0098722b28a18si7866034ejc.458.2023.07.13.09.16.46; Thu, 13 Jul 2023 09:17:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234981AbjGMP4j (ORCPT + 99 others); Thu, 13 Jul 2023 11:56:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232088AbjGMP4h (ORCPT ); Thu, 13 Jul 2023 11:56:37 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8294C26AE; Thu, 13 Jul 2023 08:56:36 -0700 (PDT) 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 Cc: Christoph Hellwig , kernel test robot , "Darrick J. Wong" , Andreas Gruenbacher , Miklos Szeredi , Matthew Wilcox , cluster-devel@redhat.com, Ilya Dryomov , Miklos Szeredi , Chao Yu , linux-fsdevel@vger.kernel.org, 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, Anna Schumaker , oe-lkp@lists.linux.dev, Andrew Morton , Hannes Reinecke Subject: Re: [LTP] [linus:master] [iomap] 219580eea1: ltp.writev07.fail Message-ID: <20230713155631.GA29281@lst.de> References: <202307132107.2ce4ea2f-oliver.sang@intel.com> <20230713150923.GA28246@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) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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;