From patchwork Thu Jun 20 17:31:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13705983 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 C725BC2BB85 for ; Thu, 20 Jun 2024 17:32:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 574D46B031B; Thu, 20 Jun 2024 13:32:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 524656B031C; Thu, 20 Jun 2024 13:32:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 37B7B6B031E; Thu, 20 Jun 2024 13:32:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 184516B031B for ; Thu, 20 Jun 2024 13:32:15 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id C4114C0431 for ; Thu, 20 Jun 2024 17:32:14 +0000 (UTC) X-FDA: 82251960588.24.44B8D57 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf24.hostedemail.com (Postfix) with ESMTP id 178F8180016 for ; Thu, 20 Jun 2024 17:32:11 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=iapsQlQF; spf=pass (imf24.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=1718904727; 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=OOxliJmAhngSfDrJfQOkQc4/7NxulOuU/yfY7uglXAU=; b=NMsyLESfeN9SInrYazHe6f+xVzjfbJvQXMP9ue6LugfLQQ6Qdn9Yu577mrkDft8sKJVX89 2qGceJQSBce42ZelWyYBPIc9qMHXCNG+CDANVpZKdvN8PTeNIm7XFT3rwwykIURG2HjKa9 7cbTvdHuwT9TsonR1gjbUqhb3H9iDrE= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=iapsQlQF; spf=pass (imf24.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=1718904727; a=rsa-sha256; cv=none; b=NDzrLTK9Va9eQSHaTMxRIsnNbJnQvUmIdzui1odg49VsYhcQQbUfCUzWvMMXqBJe386vpD 9NFixjoxwhsg9fKrOWincb833reNu8vf79Zv6V4vHvU6tasIOGR9ggJECma88u/XeEN56r JtYxMX9K1D58OZ5/ZpoFGMBUSM7nppk= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1718904731; 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=OOxliJmAhngSfDrJfQOkQc4/7NxulOuU/yfY7uglXAU=; b=iapsQlQFVBfynKldFt93Kyzx51Y9uIdTrxWlGphnp+QVwKWK2DtcnEDYdAHnJf+u1b5l3s XTYl4RsZrjOihlIAllvFfX78ryWAIhGwwF1b9dkMO0WULmXYcbtHQjdanC/kPG2T6wDpFg 0iN1kZfV/Jlcc2HafFOn64/6tbjbNKI= 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-256-xwNS2YLuPLuNd7fIfy6AIQ-1; Thu, 20 Jun 2024 13:32:05 -0400 X-MC-Unique: xwNS2YLuPLuNd7fIfy6AIQ-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 A2F4D195608C; Thu, 20 Jun 2024 17:31:58 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.39.195.156]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A4E3119560B4; Thu, 20 Jun 2024 17:31:50 +0000 (UTC) From: David Howells To: Christian Brauner , Steve French , Matthew Wilcox Cc: David Howells , Jeff Layton , Gao Xiang , Dominique Martinet , Marc Dionne , Paulo Alcantara , Shyam Prasad N , Tom Talpey , Eric Van Hensbergen , Ilya Dryomov , 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, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Steve French , Enzo Matsumiya , Christian Brauner Subject: [PATCH 01/17] netfs: Fix io_uring based write-through Date: Thu, 20 Jun 2024 18:31:19 +0100 Message-ID: <20240620173137.610345-2-dhowells@redhat.com> In-Reply-To: <20240620173137.610345-1-dhowells@redhat.com> References: <20240620173137.610345-1-dhowells@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: 178F8180016 X-Stat-Signature: jnzxkpstro16ahanpepcxj8rjgbm35nz X-HE-Tag: 1718904731-904898 X-HE-Meta: U2FsdGVkX1/1R57DHlxbh7kYoPmQwLeTk5BAQlHJadC0jnCWJ+xXgnankXfnTwHDApj8Z0pE78OqRvwuhJaZzv2JyvAWA9lgECDPe85WZW33mL0Z+Mt3fh7JyM3ooROunJgR3E+Ucua8lXhrSNihDI+1RgzlzUBqhpxsF9at4rOTZ720rsQ79luwLs0c+jmGbmLN6dwdMuleXQXqhhN1JxnA4Zo8/B+JPIxFoMpcOpRAnMOSUaVTc6Dd387uyN8hgMUacD/lTH3JTBrQwG7n30pfual1SvjC0imzil1XAArLvW3rp2hIEaqISj2VfzbQFpEdf7ypcTbDzlx/e3S9xEkYvcLA0On7E8pI5l13dz6N0H++g/nncywQAu0MnmpUdXIQtavuuxXmkgeqFmC8LPExHu6QTJgEj8Gznxz9iRD+hM8xa3NQJLBCtrWb/W1paST0ZdfSKYX+T29P0QeWhPQaha1oBx7h+6pys3RErW2mhhuLwAmeYdTq3ANsh5PIOc7XyW7PeGDiKAE3wXMkyQzLdn/IEanPyUotJg+1/Zc/UwDEVVTJyOsdJ0l+z758kYNzdA2CQve3tyzRLSCyaDuzz3ooDiEYd44anxt5NZCUKQC5SVJhmIXgoZ8IK8RS3y0K2j3tdgltmLTuzwIgCIJKTGii1mpnJe5Ifhv/0DsKRuuPjwGZe/JVVeP2nQFJV9iARdOixZsfKzOM/nx5v4XWDmLCmFQc/F9df64mdC/8R0sdjZW8kA2FdHWOs0cyDbqksvWNl4RTWF6+sHanSQKX+hxKNVCtUMk2Zz1O9Vx0J7W6ZLZvy+STakPoi1OiXorX8KSJGPiZQ6HEFLIrq5ttjW9Oz8DNffuUAW8EtyJHbzn9OMlUWcrFkwkhSVJbntFEhEXS9Js3eKlh1A21ZdwZiKxeqRsJmzPeKuSelgTsylx59MdJiVhzkma0l8r6kFsrsmYwv/EjArNjHF6 FaxFfTPO eO6UCQk4p1NL7ro3g/eyZ+Y2X+XGvP2GH+PAJ0Yw2/N0WUwupiQHb0WMjmCRenmzv0JBERxIMp2f0bJUgcgS7KjH6GHNlv074QBxHJhohbbxNWtCnMgMskUL94zw1fUPv4fsGg0VRpud0SN3BBAQ8tsRx54diAEIpqqwhmvq+QTBwCRvo0y3IhrtmEF0oFg64oETo04vbbLwkRm1mgaEQ/rn7NMX7i8XQ1pj/Y5XLV/uSjZo+Hbpw0wCPne92LFDNDGLkrTO71SoeXFk8nWmhUxEEQ7CxEiShEyO/Isl47I/A3kFVXmHOjB8rPANeUIEKZftXcPflrXyv4BQqCt1UfWE5eW/XCcDMYIwWJikEUOtbPg1pD+1ys3B1GPdmWrqWlo+3ssx8uFKfcpsUMbHzV26NrwA6e8S5udNbFb5sDNj5FCABad16Q1bq3HeJlTyK67i4ohr/dXhoartiBtYGlEOVc/Wy0Az9rurCC2jERqtm89k= 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: [This was included in v2 of 9b038d004ce95551cb35381c49fe896c5bc11ffe, but v1 got pushed instead] Fix netfs_unbuffered_write_iter_locked() to set the total request length in the netfs_io_request struct rather than leaving it as zero. Fixes: 288ace2f57c9 ("netfs: New writeback implementation") Signed-off-by: David Howells cc: Jeff Layton cc: Steve French cc: Enzo Matsumiya cc: Christian Brauner cc: netfs@lists.linux.dev cc: v9fs@lists.linux.dev cc: linux-afs@lists.infradead.org cc: linux-cifs@vger.kernel.org cc: linux-fsdevel@vger.kernel.org --- fs/netfs/direct_write.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/netfs/direct_write.c b/fs/netfs/direct_write.c index e14cd53ac9fd..88f2adfab75e 100644 --- a/fs/netfs/direct_write.c +++ b/fs/netfs/direct_write.c @@ -92,8 +92,9 @@ ssize_t netfs_unbuffered_write_iter_locked(struct kiocb *iocb, struct iov_iter * __set_bit(NETFS_RREQ_UPLOAD_TO_SERVER, &wreq->flags); if (async) wreq->iocb = iocb; + wreq->len = iov_iter_count(&wreq->io_iter); wreq->cleanup = netfs_cleanup_dio_write; - ret = netfs_unbuffered_write(wreq, is_sync_kiocb(iocb), iov_iter_count(&wreq->io_iter)); + ret = netfs_unbuffered_write(wreq, is_sync_kiocb(iocb), wreq->len); if (ret < 0) { _debug("begin = %zd", ret); goto out;