From patchwork Fri Aug 23 16:12:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13775479 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 3C891C5321E for ; Fri, 23 Aug 2024 16:12:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D1C9B6B0303; Fri, 23 Aug 2024 12:12:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CA55B6B0307; Fri, 23 Aug 2024 12:12:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B1F1E6B0308; Fri, 23 Aug 2024 12:12:46 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 90AC26B0303 for ; Fri, 23 Aug 2024 12:12:46 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 690D2121DFA for ; Fri, 23 Aug 2024 16:12:45 +0000 (UTC) X-FDA: 82484003490.12.3F6F1D4 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf18.hostedemail.com (Postfix) with ESMTP id 3EDAD1C0016 for ; Fri, 23 Aug 2024 16:12:43 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=B4jNADsy; spf=pass (imf18.hostedemail.com: domain of dhowells@redhat.com designates 170.10.129.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=1724429454; 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=UF1dQkOHc38/CxHdvA+HTnp1kknbAHEKTFkwj9qcOQo=; b=jsz7RV8ppcxpVtVsLqBQ8MRBReFY91aBU/gJApmQ36PuZooulm0kYWixlHvEWUHbdLF0ia myoQ6iPsixyEsmDr0BVzjBiyyJaQKhEKGmK9UVCdPl0H/11qVMNqg3cHiq8EDbt1dcktjO nBa/TjmrqZ2barpg1PTFIEROnH3OV4k= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=B4jNADsy; spf=pass (imf18.hostedemail.com: domain of dhowells@redhat.com designates 170.10.129.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=1724429454; a=rsa-sha256; cv=none; b=NyeIQqSQsEFkO1QbzfDxF2Up0EvQMtNW4u+uQ3LSZpg8K55wNO+UodNo4Ki3Er0T4Mq4Px F9DUyGG9dvCmqD62i8LzoH/ptESjPopJm3PHLwxA7SuAkzKGoUTQJEMfAsUzJ6tKrCae9h vNTBokHV94hGku+O4PT4upWJKKuHiAw= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724429562; 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=UF1dQkOHc38/CxHdvA+HTnp1kknbAHEKTFkwj9qcOQo=; b=B4jNADsyyUT10rwVOUheZYf9TMziINehSlVUcl2UlTxjqBFP4fELN2WWHDintqE0DXdhk3 6reXGxbWXoPSUBTSHKMYI3N9Zm9uCLMf07FNM1kLyy2SWnLDLXeIBUlVQYDhT0/YfsF5kK oYqqhPIn9Thg2mnHkT4d5YcWqBzWYpY= Received: from mx-prod-mc-03.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-99-8smGqBV2N5OacPwQdgxAmQ-1; Fri, 23 Aug 2024 12:12:39 -0400 X-MC-Unique: 8smGqBV2N5OacPwQdgxAmQ-1 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 571C51955D4E; Fri, 23 Aug 2024 16:12:36 +0000 (UTC) Received: from warthog.procyon.org.uk.com (unknown [10.42.28.30]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 11C6819560AA; Fri, 23 Aug 2024 16:12:31 +0000 (UTC) From: David Howells To: Christian Brauner Cc: David Howells , Pankaj Raghav , 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, Steve French , Paulo Alcantara Subject: [PATCH 3/5] netfs: Fix missing iterator reset on retry of short read Date: Fri, 23 Aug 2024 17:12:04 +0100 Message-ID: <20240823161209.434705-4-dhowells@redhat.com> In-Reply-To: <20240823161209.434705-1-dhowells@redhat.com> References: <20240823161209.434705-1-dhowells@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 3EDAD1C0016 X-Stat-Signature: 65tqwh17ixihpfbknqxwd1ocxcs3c9nb X-Rspam-User: X-HE-Tag: 1724429562-220574 X-HE-Meta: U2FsdGVkX18RdiczZ9Dx2w+YNY1hMTZwAIEn8B7M54NgDAe0uwsBcx4QxTGnGP64Pipd9IGPvpUxNKurtI3EvqrTZhdsSdge9/ZceTormesz0+54WNKaPp2r5V43Xi+JxQLLd0KxQ/ANuA5i0NyqY/1EXchcR82dFCsoR1vQ7HQS6M2cLga2z/cexaRYOZea30sNkkeWKsNHXLUlt4vrQBO9AnVdxqK87oZzPmZMbTxjviokLRGpl5x/kbDl3ni8TlS0beWN4iNklkTkISk281XSOfwryCUJGemfIFxrRgN13AouC0a8vDff3Q+dRfNrVx4JhFxj/f1mpgh72BclOUqHl317knNOkBUTxsoOFKWKmh8FLXVzjpvIQdP3P3GmXtepzmTrULOx1BAIIGnqZfu8Ru7cbG8DzdHGMOK7TRoL3qTUzBpcrPzPwpkK6MzbE2Zb8Q2IMP2BY9ljQGhjks9tL0tuyIy3sIy3sHYbfhUgKcCqDCNwM6shEQcli7kJPMXMXhAKHBzgbM0iyaQ4fNuZ5tavjgybzmY559SNSUXClQ9VKkb3ol5FUjKVqYl522t3ODqzejAfrJr5Nc6Yg5MoHtSVp8ne5wvkIJM7ALe7cB+A/37C7iEgBDJNN2bZJa6bVkXv65CGZ72YLD6k7hZgkxCuMclnqRwme8sPe0NlnE6rnOMgzTBwUVJlvELLPiJwkSD41CTIn3Ksx1zc7wIFs1PxW5+/F1j62x6Jql3myrBIC8KW+8xYicweIaAkmhSGzdc1hrjVcPtz+sCDMIY+HfkWqOD0RNDRzPUN1A/iVgaFn+ACgXs27S0VWfCao4jB7IAvQ0zUf8c6HJwqf9yH1++N4fm++QGoKcUlIL0cqDzQivqkXLMNrBjP2KIpZ7neHASbmRq3pFf+jXFD/czA1Ngq9Q6VcqDwYWcDOh/KSI5bVEfa/uSrshyHie2vADyfxjm1TOFWxy2Ig6r uADAXn7x BRredTbvMGMpgh6bmmcaXHf3/HCV8tvyl0h4ggqBzC20ANHjIpCzECsUY4BKV6QsKqi3qmn3THawqkLvoAdPMggYbUhjT5+uvmzvIwVbrUaoCvOeBu/2PVgDmduVKVtvKMoPIN88AlCLr7FZGecklJQFD2qLZtVbIgw8gqzzo952ZuvSVEo0K1aWnSMPKiXtKV0rwRhIJ6AYt10HNcA+FcfGLCiaFWZYIWK9wpQ3hR45pAhA3B5bDonFZY5ggNyk2XKS+sulN7g2zo1ad3YM4YXcmAhOQKtU3uugVulcnnuJm07mpDJdbylGua9Gk0IiMc0i25t22lZr424SM3CRW8zCocpl80mc+wERxCsL5ZRHlxMCVG/xU1mJAUbJgLKcsfKBjDyEJZvrKdxUIOoU8ZjqJbrFmFYFqK7arVLrV/EwtkGMZ25kcBypIplbxxVTxoI5Sv5y7nJ77NSNDVbsK3s2idtd1lyMNesws 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 605b667fe3a6..d6ada4eba744 100644 --- a/fs/netfs/io.c +++ b/fs/netfs/io.c @@ -315,6 +315,7 @@ static bool netfs_rreq_perform_resubmissions(struct netfs_io_request *rreq) netfs_read_from_server(rreq, subreq); } else if (test_bit(NETFS_SREQ_SHORT_IO, &subreq->flags)) { __set_bit(NETFS_SREQ_RETRYING, &subreq->flags); + netfs_reset_subreq_iter(rreq, subreq); netfs_rreq_short_read(rreq, subreq); } }