From patchwork Fri Aug 23 20:08:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13775935 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C2F86C5321D for ; Fri, 23 Aug 2024 20:09:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 53E5B6B0308; Fri, 23 Aug 2024 16:09:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4EDCA6B030A; Fri, 23 Aug 2024 16:09:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3DE7A6B030B; Fri, 23 Aug 2024 16:09:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 1D6EC6B0308 for ; Fri, 23 Aug 2024 16:09:10 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id BC61481E85 for ; Fri, 23 Aug 2024 20:09:09 +0000 (UTC) X-FDA: 82484599218.03.33BCD51 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf09.hostedemail.com (Postfix) with ESMTP id E68E614002B for ; Fri, 23 Aug 2024 20:09:07 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="PbPaHx/f"; spf=pass (imf09.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1724443682; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=J+Q2VjHdhruKVNJRsL+DNuwA1V8DkjXpTij4fAf/kXM=; b=K2n44lv7Nd0IaCNRddX147RcSsYBQNyWBJhI8pdwn2Tg/pyS25g8LPIj8t3D1k58lcEfj4 avz2vs+y4BV8jbOVPJLfrtVNImI8OZ0sCP3VpRD81/0QKc7FpCfdhLFPGIzbkuaheNgF0z jR6DmWPrhtDBqTYub56jltQEnq6FmZ4= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="PbPaHx/f"; spf=pass (imf09.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724443682; a=rsa-sha256; cv=none; b=q/MljYJQtLX5kqfLf24R7AOco7CJNaL+ByTMwlexYhGBrL/hxV0IP0RWziTYpSuHj2qTJi s7DWF/csYqygAuxePRcIby2u1VIjzyP9hwsjgAbbdP7tT9iecF/Rwo/rMsnbcHF4sd5QrC OVUyeFgU/aWWVEivw8K7NHokP44wZB8= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724443747; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=J+Q2VjHdhruKVNJRsL+DNuwA1V8DkjXpTij4fAf/kXM=; b=PbPaHx/fPP54Bw874NsvZmT1iFpCzay78CIXmDjOJP7pgRWGviPQ6je4hFdxYHUMMcVx+T oSib5xd14O6aFOc6+EhJIGaQ390tT6moGeygSt9rMsFyk/1poFg4Dn9cRxcJDaGkHHPWrw YIShIkXCXG5SpWxlrBT3yzGEcty/6Pw= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-562-iX0mBMvkOMy-sMazWAhTNw-1; Fri, 23 Aug 2024 16:09:01 -0400 X-MC-Unique: iX0mBMvkOMy-sMazWAhTNw-1 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6A0991955D48; Fri, 23 Aug 2024 20:08:59 +0000 (UTC) Received: from warthog.procyon.org.uk.com (unknown [10.42.28.30]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 90C0319560AE; Fri, 23 Aug 2024 20:08:54 +0000 (UTC) From: David Howells To: Christian Brauner , Steve French Cc: David Howells , Pankaj Raghav , Paulo Alcantara , Jeff Layton , Matthew Wilcox , netfs@lists.linux.dev, linux-afs@lists.infradead.org, linux-cifs@vger.kernel.org, linux-nfs@vger.kernel.org, ceph-devel@vger.kernel.org, v9fs@lists.linux.dev, linux-erofs@lists.ozlabs.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 5/9] netfs: Fix missing iterator reset on retry of short read Date: Fri, 23 Aug 2024 21:08:13 +0100 Message-ID: <20240823200819.532106-6-dhowells@redhat.com> In-Reply-To: <20240823200819.532106-1-dhowells@redhat.com> References: <20240823200819.532106-1-dhowells@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Stat-Signature: zzpzqsdbtekf6us5xru4ii1pna311opi X-Rspam-User: X-Rspamd-Queue-Id: E68E614002B X-Rspamd-Server: rspam02 X-HE-Tag: 1724443747-526713 X-HE-Meta: U2FsdGVkX196w0Q8TW7hqP7/qzztRRWnYi3/vcwohyc+zBIO4L7AxOWTAeGvXNgbKn2g1+3rAQ03yiSwCAytHxEgjHcgnYY0WB58bUQ56dccHrGOi574odQhOc1P1HhXH5TnG4/pq6E8iGGcwzjfDilcF+WCtgsuqs6zdEN46yYf0j1/ElV8fW7n6t2HwQcgox+ZQd1AqOq+fcPKJGKkRhOA8+wle7UAeC62s1MCn9O9mNM+wLNuXsgPmArW5cTxUXvtUFl2sVSLWcy/CCAudmgGA55C+MyCv9k/UcJWhe9fkYVeAto1pAj3zmVtdFdzGB2q6YNqOxeb+NJeHBI51S1XhJGXEk7s0KUWUygUjlvbzq1w9gC64p9Vzyati2zo/f7h77zzmsL7K6XM4P8lztahHFrsdTL71cwxHxRHOFpfniuDF1j8byNv4hNg7KXi6y7UDXeDKtbVePkBcEHdZhLFMeQ01jizT25MN0GzxaAaSj8BtLPni0zfjgOR25PVNThlYQrxJ0EgpQBLOVU9keJjAgA8JyNvSkBK38P5NXBEpn6bb4NakY2XpTFn00BeNYgNCzCmqKVj8VL056vic64wCKAqtx8GK0BLsUPBag6K3ISRePKStuoV1Z47JpXmmr94ldLLmKeKMoQu4yey/bTsMhP9OhE07ARmkk51muHm7TvdGo8K8+GCK81IJYvCsnDpfGdDvm3Ehf842Kfgz0WyXy9Dc2SU+1hxPa8RSDXrXGd5uBmOvSWy4xcQzV8VpV+1YcxBH9rmQWLcUoelgQjNrTFLdT8b2siUunv2qIBWvl0n5h4+phiY6u9L5Th1AY/JP7BrP1WS9ZVUztY7BIqvJfMnzDiCT8TyXLh5fdwEHYRB6stMJjp8xsE7OMtPzQ14ykneP9JsX4rb3RN09b4Pvr8vyNBzoL2y4wC+s65ZBOQexWSkZR6fOupu4jkedZEZJQcOKS3WfTUYQ2l MnxhXN62 cKlE6kyvR0/6uh7KW/Kzp5vWJUPdFHGWdW8QvHR9xmnBHiQJvEtPFWcGp1bkrkDiuWe2+DRMwR6KucY+NJgEPAz5hy9v3iF8lTUqLst9eZQWV3kR+Rfs+9JeQYxw4MLwao2YXzqGGIfYCd8cs1gAQ8Ynz2mk3F0Ducu4J8Z/hAedGbWZXVvvFYTP4Xa9v4xVE/xkm4jILvKAUfIYdDnB00/75QZO+QGjOq1n5f5AoOdLor6SKoZCoewTjBAJIRFqryNlyrwrRPfkpqADr3yoOXcakf4uWiDZpfQY/7p7MiD3cI90QsInblGrIU1jhpo40t3nvPUaVypF0tUlNel2VxR392c9+ayNRiVuoTK00lnrfYiSBV4u5d74JSte/2Po7LOPMW6FgqRzdQduLmqLTAwbOQC/E2WDc+aSZPvDMsGEuUGy3U0rpMZjXe97Y5g8/nGkmqsPJAsKVfEOAzZjWKI/ShHLxHBVRamt7 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Fix netfs_rreq_perform_resubmissions() to reset before retrying a short read, otherwise the wrong part of the output buffer will be used. Fixes: 92b6cc5d1e7c ("netfs: Add iov_iters to (sub)requests to describe various buffers") Signed-off-by: David Howells cc: Steve French cc: Paulo Alcantara cc: Jeff Layton cc: linux-cifs@vger.kernel.org cc: netfs@lists.linux.dev cc: linux-fsdevel@vger.kernel.org --- fs/netfs/io.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/netfs/io.c b/fs/netfs/io.c index 5367caf3fa28..4da0a494e860 100644 --- a/fs/netfs/io.c +++ b/fs/netfs/io.c @@ -313,6 +313,7 @@ static bool netfs_rreq_perform_resubmissions(struct netfs_io_request *rreq) netfs_reset_subreq_iter(rreq, subreq); netfs_read_from_server(rreq, subreq); } else if (test_bit(NETFS_SREQ_SHORT_IO, &subreq->flags)) { + netfs_reset_subreq_iter(rreq, subreq); netfs_rreq_short_read(rreq, subreq); } }