Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp1289583rwp; Thu, 13 Jul 2023 08:44:37 -0700 (PDT) X-Google-Smtp-Source: APBJJlHvSsNfxnSQYZPoOuTeECkUJneRkmWG/wVD586+sLcfaD/sybGSNKNdRjYjCVSeD2Dy12Y5 X-Received: by 2002:a17:906:51dd:b0:993:d901:9b46 with SMTP id v29-20020a17090651dd00b00993d9019b46mr1544251ejk.3.1689263077023; Thu, 13 Jul 2023 08:44:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689263077; cv=none; d=google.com; s=arc-20160816; b=zlKjs6bOc8Yw2tCKg7gdguXQJfuArGQCqXUl+vaxIYmHHC17XVAE3p0YBS9a7M7kP9 j0IffUPJI0gMh+T14BWUBmzeQtyj2vjrmLKwdt8XBLVTOPRjYsjrmLgISRld98JVkNVY qO2BK9+zL3CpaIkZn/dFJ8wlzKqoZFLzhjYKBjGBnhLxpfdvrukAWhp4I3KZDv/0DaeQ ka+vO3o6SJgS6DkG3MJU0PrPBGFvwzpKS6UufUH+t3KXXuDJYtEe4Vq2fkFFxH/NNovp sG45qThKLRArio0ilRx5WPaxj/3X030Hn0dUZeqUMGmJTCya58AFmkzAD1wizz20aLTh DOCg== 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 :dkim-signature; bh=ZnsbM2wbDJKZoJO63kCqa7skAvyrvbFpqW+OFngO6J0=; fh=6q+ABBpV0Gjc9hce7w9bWEBN3/F/A8Wbiyxl1MSZ1XE=; b=xbubPoSnVZVKVZUQhD2wxdMDipuMMuomnFoHN+pgDiFBIG+Da8mJA4usaljoy6h4c6 VWQlRtUYvFpRAMN19K/97lM4GdDBwuBcNmVsdD5ATr+f6GmzZeLec0PvfCGbxtSZmMu9 +M83S7xpl7yV6Ul4x4Me8EL5Wimni7WT4gCdicf5gYt6bdcDmZ2d0UZmgxIb5fi5jo0A D9PNPLuNmlxXU3Ud1GIrHGYYxDq/iadq/A+y4EsyYfmdFItgw1rNAhkv+dVjg/zhTklC j/tqzGPLOJW26UWN0sRX1KC78d2S7duDAuSwCR/pzJkY2bKJTPqB8B+snm4fz24vo8wP NubQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=sV1pgtAi; dkim=neutral (no key) header.i=@suse.cz header.b=9pXKKiCX; 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 v20-20020a170906339400b0098e24139529si6738028eja.733.2023.07.13.08.44.12; Thu, 13 Jul 2023 08:44:36 -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; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=sV1pgtAi; dkim=neutral (no key) header.i=@suse.cz header.b=9pXKKiCX; 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 S234736AbjGMPeG (ORCPT + 99 others); Thu, 13 Jul 2023 11:34:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232007AbjGMPdw (ORCPT ); Thu, 13 Jul 2023 11:33:52 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD6981FD4; Thu, 13 Jul 2023 08:33:51 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 5C41522185; Thu, 13 Jul 2023 15:33:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1689262430; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ZnsbM2wbDJKZoJO63kCqa7skAvyrvbFpqW+OFngO6J0=; b=sV1pgtAi27tWlGMws6tV7hf/GEtyL/tfm4WbvICemOjJMuus/p2+X17CiUlFl/l1j+rjgD xKsKyh+PUXOM5Mtqqoc/ExfUrXx6RAHwtZ6Lb7OFEryuzF6O5kA/QwwDb0pnIavlwHUUdU pG3UxM2hej8IJ+lTSLLmhqbB30xUz/0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1689262430; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ZnsbM2wbDJKZoJO63kCqa7skAvyrvbFpqW+OFngO6J0=; b=9pXKKiCXJGy/exWne0PvxfT2nb5/QqIeeq771ADv8xv5NQVJ9/i551YInR/xTA9frjX5m8 AoqlkLi8oC3II5Bg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 42C8613489; Thu, 13 Jul 2023 15:33:50 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id e3taEF4ZsGTsGAAAMHmgww (envelope-from ); Thu, 13 Jul 2023 15:33:50 +0000 Date: Thu, 13 Jul 2023 17:34:55 +0200 From: Cyril Hrubis To: Christoph Hellwig Cc: 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: 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: <20230713150923.GA28246@lst.de> X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_SOFTFAIL,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 Hi! > I can't reproduce this on current mainline. Is this a robust failure > or flapping test? Especiall as the FAIL conditions look rather > unrelated. Actually the test is spot on, the difference is that previously the error was returned form the iomap_file_buffered_write() only if we failed with the first buffer from the iov, now we always return the error and we do not advance the offset. The change that broke it: diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c index 063133ec77f4..550525a525c4 100644 --- a/fs/iomap/buffered-io.c +++ b/fs/iomap/buffered-io.c @@ -864,16 +864,19 @@ iomap_file_buffered_write(struct kiocb *iocb, struct iov_iter *i, .len = iov_iter_count(i), .flags = IOMAP_WRITE, }; - int ret; + ssize_t ret; if (iocb->ki_flags & IOCB_NOWAIT) iter.flags |= IOMAP_NOWAIT; while ((ret = iomap_iter(&iter, ops)) > 0) iter.processed = iomap_write_iter(&iter, i); - if (iter.pos == iocb->ki_pos) + + if (unlikely(ret < 0)) return ret; - return iter.pos - iocb->ki_pos; + ret = iter.pos - iocb->ki_pos; + iocb->ki_pos += ret; + return ret; } I suppose that we shoudl fix is with something as: diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c index adb92cdb24b0..bfb39f7bc303 100644 --- a/fs/iomap/buffered-io.c +++ b/fs/iomap/buffered-io.c @@ -872,11 +872,12 @@ 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); + 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; } EXPORT_SYMBOL_GPL(iomap_file_buffered_write); -- Cyril Hrubis chrubis@suse.cz